diff options
Diffstat (limited to 'doc/Coding_style')
-rw-r--r-- | doc/Coding_style | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/doc/Coding_style b/doc/Coding_style index d0eba0d..d57dcf1 100644 --- a/doc/Coding_style +++ b/doc/Coding_style | |||
@@ -1,10 +1,8 @@ | |||
1 | The coding style is almost the same as i blackbox. | 1 | The coding style is almost the same as i blackbox. |
2 | Instead of 2 spaces there is tab. | 2 | Instead of 2 spaces there is tab. |
3 | It might look strange now in some places, that is because | 3 | Use a tab size of 2 or 4 and you will be fine. |
4 | the code hasnt been "translated" to tab 100% yet. | ||
5 | Use a tab size of 2 and you will be fine. | ||
6 | 4 | ||
7 | note if-statement: | 5 | if-statements: |
8 | 6 | ||
9 | if ( stuff ) | 7 | if ( stuff ) |
10 | function(stuff, more stuff, | 8 | function(stuff, more stuff, |
@@ -15,7 +13,7 @@ note if-statement: | |||
15 | stuff, | 13 | stuff, |
16 | stuff); | 14 | stuff); |
17 | 15 | ||
18 | if the functionline needs to be split up, like above, right after a if-statement | 16 | if the functionline needs to be split up, like above, right after an if-statement |
19 | use { and }, so its clear when the if-statement ends. | 17 | use { and }, so its clear when the if-statement ends. |
20 | It should look like this | 18 | It should look like this |
21 | 19 | ||
@@ -29,8 +27,15 @@ It should look like this | |||
29 | stuff); | 27 | stuff); |
30 | } | 28 | } |
31 | 29 | ||
32 | The includeguards: | 30 | If a line need to be splited in an if-statement then it should use two |
33 | _FILENAME_HH_ | 31 | tab for indent next row in if-statement like this: |
32 | |||
33 | if ( longline && longline && longling && | ||
34 | longline && longline && longline) | ||
35 | funktion(); | ||
36 | |||
37 | The include guards: | ||
38 | FILENAME_HH | ||
34 | 39 | ||
35 | 40 | ||
36 | Function comments: | 41 | Function comments: |
@@ -43,3 +48,11 @@ Function comments: | |||
43 | type classname::function(...) { | 48 | type classname::function(...) { |
44 | 49 | ||
45 | } | 50 | } |
51 | |||
52 | |||
53 | enums must be in uppercase letters and not in file scope: | ||
54 | enum {WHITE, RED, BLUE}; | ||
55 | |||
56 | Class data members are prefixed by m_ | ||
57 | Class member function will be organized accordning to creator, | ||
58 | manipulator and accessor categories. | ||