Skip to content

Code Conventions

Daniel Waddington edited this page Jul 12, 2019 · 6 revisions

Naming Conventions

Variables - all lower case, try to use meaningful names (e.g. avoid a,b,c,x,y,z), try and be consistent (e.g., len vs. length)

Parameters - all lower case with underscores

Class names - capitalize first letter only. Use underscores to tokenize names

Class methods - all lower case, underscores can be used to tokenize name

Member variables - all lower case, prefixed with underscore, underscores can be used to tokenize name

Namespaces - all lower case (there are some with uppercase first letter)

Constant expressions - all upper case with underscore tokenization

Struct without methods - all lower case struct name, lowercase fields, no underscore prefix

Struct with methods - same as classes

Parameter Passing

In parameters - use const qualifer when possible

Out parameters - use reference (&)

InOut parameters - use reference (&)

Clone this wiki locally