CodingStandards
Coding standards
General
- A TestSuite containing one or more UnitTests will be written for each primitive, be it public or private
- Tests will be automated when possible.
Forth code
In order to provide some consistency the following standard will be used:
- the names of the primitives will be prefixed with a meaningfull name , eg: SCREEN.cls SCREEN.puts, MEMGR.ALLOC, etc
- Meaningful names will be used for public primitives
- Each word definition must have a stack comment
- Each word definition must have a description
- Each code line may have its resulting stack state
- The : word must be written on the first column of the line
- Each non defining code line must be indented by at least a group of spaces (number to be stated)
- Each definition closing word ; must be indented by a group of spaces
- Tabs should be avoided, because Bug, tCom's debugger does not display them correctly but shows a #9 character
Example:
: +* ( a b c -- a+b*c)
* ( a b*c )
+ ( a+b*c )
;
Links: HomePage