For variables, we use camelCase:
int gold;
int healthPoints;
string reallyLongVariableNameM8;
string datBoi; // o shit waddup
// etc...
Like a variable: camelCase:
bool toBeOrNotToBe();
int getQuantityOfDeadMemes();
All uppercase with underscores:
const int WINDOW_WIDTH = 640, WINDOW_HEIGHT = 480;
const int DAYS_IN_A_WEEK = 7;
For type names we use Pascal case:
class MyNewClass;
struct Vector2f;
enum CharacterClass;
// etc...
Filenames should be all lowercase and can include underscores:
foo_bar.cpp
We use curly brackets as following (this applies to loops, switch statements and functions as well):
if() {
// ...
}
Tabs for indentation (4 spaces width), spaces for aligning.
Keep the line length 120 characters max.
We use spacing for all operators excluding the following:
(), ;
Space on right side of * operator like this:
char* thePointer;