1 This file has been copied from the kicker HACKING file from Aaron Seigo.
3 While you may notice that there are many discrepencies between
4 the code and this document, all new development should
5 follow the coding style as described below amd one day the codebase will
6 actually be consistent!
10 Class names start with a capital letter, member variables begin with m_.
11 Methods and functions start with a lower case letter.
16 Tabstop is 4 spaces. No tabs, only spaces.
18 Try to keep lines under 80 characters in width. When wrapping a single
19 logical line of code across multiple lines, new lines should be indented
20 at least once and should preferably line up with parentheses, if any, on
23 someMethod(parameterOne, parameterTwo,
24 parameterThree, parameterFour);
26 If a boolean expression is spread out over several lines, the boolean
27 operator is always the last item on the line, e.g.:
29 if ((condition1 || condition2) &&
31 (condition4 || condition5))
34 Switch statements should have the case line indented and the case block
35 itsel further indented, e.g.:
51 A single space should appear between keywords and parentheses, eg:
57 No spaces appear between function/method names and parentheses:
62 No spaces appear between opening closing parens and the arguments:
64 for (int i = 0; i < count; ++i)
66 Spaces appear between operators, e.g.:
69 someObject.setValue(someObject.currentValue() + 1)
74 Braces always appear on a line by themself, indented to align with the
86 Unless it uglifies the code, use braces even for one-liner conditionals:
93 Always use braces if the conditional expression wraps across multiple
96 Braces around case blocks in switch statements are optional.
101 Constructors are written as:
103 MyClass::MyClass(...)
113 Class definitions will follow the following order:
115 class <name> : <scope> <superclass>