Skip to content
Phil Burk edited this page Dec 31, 2016 · 8 revisions

DRAFT Style Guide

This guide is a work in progress. I welcome input from other developers.

PForth currently has very inconsistent style. I would like to have a consistent style for new additions. And I may apply the new style to old code.

General

Indentation - 4 spaces, no tabs, no trailing spaces

Forth

  • Capitalize new words when they are defined.
  • Capitalize conditional words, eg. IF ELSE THEN WHILE REPEAT etc.
  • Lower case for other words, eg. dup swap etc.
  • Align conditionals.

For example:

: NEW.WORD ( x y -- , do something interesting )
    2dup =
    IF +
    ELSE *
    THEN
;

'C'

Clone this wiki locally