Changes between Version 2 and Version 3 of CodingRules


Ignore:
Timestamp:
11/26/13 11:40:58 (12 years ago)
Author:
tbretz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CodingRules

    v2 v3  
    20200. If you use the ?:-operator, put white spaces around the ? and the colon. Try to keep the rest without white spaces.
    21210. Avoid to assign variables just to give something a different name, use comments.
    22 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!
     220. 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!
    23230. 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!
    24240. Whenever possible propagate const-references instead of copying the argument. This is an optimization issue.