Next / Previous / Shipman's Home Sweet Homepage / Site map

My Cleanroom naming conventions

Here are my conventions for forming names.

Python conventions

batCount, mungeAggregate()
Names of variables, functions, and methods start with a lowercase letter and use internal capitalization to delineate words.
ScrolledList
Class names are capitalized, with words run on and internal capitalization.
MAX_DEPTH
Manifest constants are capitalized, with underbars between the words. Since Python doesn't have anything like C's #define, these are usually just variables assigned a value at the top of the module. The capitalization is a reminder that in the body of the program they are read-only.
closest-ancestor
Notational definitions are lowercased, with words separated by hyphens. These names do not occur in actual Python code; they are used as shorthand within intended functions.

Icon conventions

inFileName
Variables start with a lowercase letter and use internal capitalization to delineate words.
PathMap
Class names are capitalized, with words run on. Class names are not actually used in the Icon code; they are just there for documentation.
Topic_Depth
Procedure names are capitalized, with underbars between the words. For procedures that are used as methods, the convention is to start with the object's class name. For example, "Topic_Depth" is a method on the Topic object.
Condition_Is_Skipping
Methods used as predicates contain the word "_Is_"; by convention, these predicates fail if false, and return a value (typically &null) if successful.
topicTag
The actual state for an object is generally an Icon record whose name is the class name, lowercased, with the word tag appended.
index-report
Notational definitions are lowercased, with words separated by hyphens. Again, these names do not occur in actual Icon code; they are used as shorthand within intended functions.

Next: Cleanroom examples: Prime number testing
See also: Example programs written in Cleanroom style
Previous: My Cleanroom object library
Site map
John W. Shipman, john@nmt.edu
Last updated: 2002/09/28 22:42:22
URL: http://www.nmt.edu/~shipman/soft/clean/naming.html