Changes between Version 18 and Version 19 of CodingRules
- Timestamp:
- 11/29/13 09:07:24 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CodingRules
v18 v19 33 33 0. Source files have the extension cc, header files the extension h, C source files just c. 34 34 0. Operators +=, -=, etc. are preferable over constructions like x=x+, x=x-, ... 35 0. If you omit intentionally a break in a switch statement (*fallthru*) add a comment 35 0. If you omit intentionally a break in a switch statement (*fallthru*) add a comment (only necessary *after* code between two case-statements, not necessary if there is nothing at all between two case statements) 36 36 0. Sometimes including system headers is not identical for all operating systems, comments might help 37 37 0. Try to avoid using dynamic allocation whenever possible: "int i=5; /* do something with i*/; /* i runs out of scope */" is preferred over "int *i = new int; *i=5; /* do something with i */; delete i;" Although this example sounds ridiculous, the same is true for every class instance you allocate.