Whitespace

Code style

Function and variable naming

Prefixes

There are two types of prefixes, which can be used in conjunction. They make code easier to understand and use, and help with code autocompletion. These are scope prefixes and usage prefixes.

Scope prefixes

Scope prefixes consist of one character and are followed by an underscore.

You must use the following prefixes:

a
function argument/parameter
m
(non-static) class member

Usage prefixes

Usage prefixes consist of one or more characters and follow the scope prefix, if present.

You must use the following prefixes:

i
index (of for loops, arrays, and objects that use the subscript ([]) operator in the same way)
k
constant
n
amount of something
p
pointer
pp
pointer to pointer

Examples

m_x
A member variable named x.
a_pSprite
A function argument parameter that is a pointer to a sprite.
knBitmaps
A constant of an amount of bitmaps.