Conventions

21 Nov 2014

Here are the conventions to use in the piles.

Files

All file names are lower-cased. The words are separated by underscores: example_file.cc.

Preprocessor definitions

These should be upper-cased with underscores indicating the word boundaries.

#define EXAMPLE_VALUE 567
#define EXAMPLE_MACRO(__param__) (__param__+1)

The macro arguments should be enclosed in two underscores to avoid confusion.

Namespaces

Namespaces are lower-cased; most of the time they should consist of a single word.

namespace example {

} // namespace example

The end of the namespace should also be clearly identified.

Classes

The name of the class is camel-cased.

class ExampleClass : public BaseClass {

}; // class ExampleClass

The end of the class should also be clearly identified.

Tagged with walkthrough