Changes between Version 17 and Version 18 of CodingRules


Ignore:
Timestamp:
11/26/13 16:18:33 (11 years ago)
Author:
tbretz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CodingRules

    v17 v18  
    23230. In argument lists, use a white space after the comma, not before.
    24240. If you use the ?:-operator, put white spaces around the ? and the colon. Try to keep the rest without white spaces.
    25 0. Avoid to assign variables just to give something a different name, use comments.
    26 0. Use white spaces around logical operators (&&, ..) in conditionals (==, <= are conditonal operators, not logical operators). This mimics the priority of the operators and makes the condition easier to understand. Try to keep the calculations compact. Avoid unnecessary parenthesis. If you are not sure, check operator priorities. This is a language issue nothing random from the compiler!
     250. Avoid to assign variables just to give something a different name, use comments. Generally, do not invent variables for something which is only used once, except it helps for example to keep a function call much shorter.
     260. Use white spaces around logical operators (&&, ..) in conditionals (==, <= are conditional operators, not logical operators). This mimics the priority of the operators and makes the condition easier to understand. Try to keep the calculations compact. Avoid unnecessary parenthesis. If you are not sure, check operator priorities. This is a language issue nothing random from the compiler!
    27270. Avoid using line long variable names. They should not be too short either. *timv* doesn't tel us much, but *myVar* tells us as much as *thisIsMyVariable* but makes code more compact thus better readble. Don't use variable names to explain their contents, use comments!
    28280. Whenever possible propagate const-references instead of copying the argument. This is an optimization issue.