Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
This patch should show how to code style should be for the BGE in future.
Basically it follows the Blender code style Wiki. http://wiki.blender.org/index.php/Dev:Doc/Code_Style
But there some things that are not described in the Wiki. So I use this patch to show how I think it will be the best.
- Single line comment with // in C++ files [1294].
- No curly brackets in on single line if statements [1328].
- One line space after an if statement with return or return macro (Py_RETURN_NONE) [1286-1288].
- Only one line space between methods [1383 left original].
- No one line space after #ifdef, #else, #endif [772 left original].
- Colon for constructor in new line [26].
- Using Null instead of 0 for pointers [1254].
- Don't align variables, method prototype and comments [45].
- Variable comments on the right [45].
- Comment above method prototypes. Not right or below [no example].
- One line space above a line comment [135-136].
- Using Blender Doxygen style comment (/** * */) also for a single line, not /// [no example].
- Comment out code with // [446-452].
- Every code should have his own line [658-666].
- Remove spaces for array initialisation [1173].
- Don't move method argument in a new line if there is pace to put every in one line [574].
- No strict 120 character line break if it is only one to two letters to long [1226].
Comment Actions
One comment, I would prefer that branches always use an explicit block. What I mean by this is I prefer
if (var) {
do_something;
}to
if (var)
do_something;It's a couple of extra characters, and it helps protect against silly errors in the future.
Comment Actions
There is on open question. Should we use use curly braces for cases or should we mix it?
Because some cases are need curly braces.
case UNI_FLOAT:
or
case UNI_FLOAT:
{
}Comment Actions
Change my mind on point 2. Now using curly brackets also for single line if statements.
Done requested changes.