This section contains additional notes on style conventions.
For readability, the following have been explicitly rejected:
Hungarian notation, encoding the type of the variable into the variable name. For example iSize
for variable named size
of int type.
Using get
prefix in getters. It is clearer to read if (cow.weight() > 5)
than if (cow.getWeight() > 5)
.
Using is
prefix in boolean getters (except for the exception). This prefix leads to long inflections. It is clearer to read if (overlaps(sphere, alignedBox))
than if (isOverlapping(sphere, alignedBox))
.
const integer index = i * 5 + 1;
. Exception: Do not specify function parameters given by value as const. This makes function declarations look odd and thus harder to read because it is unconventional. This rule was deprecated, because it may interfere with move-optimizations.