forked from pioneerspacesim/pioneer
-
Notifications
You must be signed in to change notification settings - Fork 1
Coding conventions
John Bartholomew edited this page Oct 22, 2011
·
1 revision
Class names in camel case starting with upper case like so:
class MyClass {};
Class member variables prefixed with m_
, camel case starting with lower case:
class MyClass { public: int m_someValue; std::string m_anotherValue; };
Note that to avoid verbosity the above is not followed for classes that are used more like structs, like vector3.
Class functions should be camel case starting with upper case:
class MyClass { public: void MyFunction() {} };
Global variables must be prefixed with g_
, and use camel case starting with lower case:
int g_screenWidth;
Variables with static scope should be prefixed with s_
:
static int s_someGlobalForJustThisFile;