1,079
edits
(→Doxygen documentation comments: updated doxygen link) |
(→Naming: Elaborate / clarify a bit) |
||
Line 139: | Line 139: | ||
'''Constants''' | '''Constants''' | ||
Basically, you have two choices: | Basically, you have two choices (this has historical reasons, and we probably should try to unify this one day): | ||
<pre> | # Camel case with prefix 'k': <pre> kSomeKludgyConstantName </pre > | ||
kSomeKludgyConstantName | # All upper case, with words separated by underscores (no leading/trailing underscores): <pre>SOME_KLUDGY_CONSTANT_NAME</pre> | ||
</pre> | |||
or | (As a side remark, we recommend avoiding #define for creating constants, because these can lead to weird and difficult to track down conflicts. Instead use enums or the <code>const</code> keyword.) | ||
< | |||
</ | |||
'''Classes''' | '''Classes''' | ||
Camel case starting with upper case. | |||
<pre> | <pre> | ||
Line 159: | Line 154: | ||
</pre> | </pre> | ||
'''Class | '''Class member variables''' | ||
Prefixed with '_' and in | Prefixed with '_' and in camel case (Yo! no underscore separators), starting with lowercase. | ||
<pre> | <pre> | ||
Line 169: | Line 164: | ||
'''Class methods''' | '''Class methods''' | ||
Camel case, starting with lowercase. | |||
<pre> | <pre> | ||
void thisIsMyFancyMethod(); | void thisIsMyFancyMethod(); | ||
</pre> | |||
'''Global variables''' | |||
In general you should avoid global variables, but if it can't be avoided, use 'g_' as prefix, camel case, and start with lowercase | |||
<pre> | |||
int g_someGlobaleVariable; | |||
</pre> | </pre> | ||
edits