Changes between Version 14 and Version 15 of CodingRules


Ignore:
Timestamp:
11/26/13 16:14:35 (12 years ago)
Author:
tbretz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CodingRules

    v14 v15  
    42420. directory names should be lower case only (to easy distinguishable from source code files)
    43430. typedefs should end with a _t like UInt_t
    44 
     440. Try to avoid code repetitions. Invent a new function instead.
     450. Move code to their own function, If otherwise the structure gets too complicated. A typical example is "MyClass *ptr = new MyClass; CallFunction(ptr); delete ptr;" is much easier than "MyClass *ptr = new MyClass; if (...) { delete ptr; return; } if (...) { delete ptr; return; } delete ptr;" In a similar case "int i = Find(a);" with something like "int Func(int a) { for (int i=0; i<n; i++) { if (x[i]==a) return i; if (x[i]==a+1) return a+1; ... } return -1; }" then if you try to construct the same with breaks and variables declared outside of the for-scope.
    4546
    4647