Identifiers are used for variables, handlers, events and objects.
Identifiers use letters and digits, no underscores or hyphens.
Each word starts with a capital letter (including, for consistency, the first one!).
There may be one or two lower-case prefix letters to indicate usage.
- CheckInput (a handler)
- MouseUp (an event)
- nLines (a variable)
- lVeryLongDateSpecification (a variable)
- Switches (a field)
- hSwitches (a header (label) field)
Some kinds of variables are distinghuished, independent of the data type contained in them. The distinction is by kind of use, and is indicated by a prefix letter:
- g global
- l local
- f formal parameter
- p object property
- i local index (loops, arrays)
- n number of things
- c constant
- l length
g, l, f, p are scope prefixes, i, n, c, l are type prefixes.
Thus a global variable used to hold the number of graphics on a card might have the name gnGraphics, while a local variable to hold a similar count could be named just nGraphics. A variable holding the length of something may be called llInputText if it is local and glInputString if it is global.