Identifier Names - Shortenings
Shortenings are forbidden.
Short identifiers are identifiers which have less then three letters. Such identifiers should be avoided if possible.
Certain short identifiers are reserved. These are:
x |
X dimension, length |
y |
Y dimension, width |
z |
Z dimension, depth |
Common short identifier names, and their replacements
x, y, z, j, i, it |
loop iteration variables |
Use iterator word with a prefix or suffix what is the iteration subject. Example: iterator_x is a name of an iterator over X dimension Example: locomotive_iterator is a name of an iterator over a container of locomotives |
mgr |
Manager class |
Use full name: manager |
tmp |
Temporary variable |
Use full name: temporary Attempt to embed info about what sort of temporary data is held: bad: locomotive temporary; good: locomotive current_locomotive; |
ret, res |
Return value holder |
Use result name |