Changes between Version 2 and Version 3 of coding_rules


Ignore:
Timestamp:
01/10/11 10:34:06 (14 years ago)
Author:
Mathieu Morlighem
Comment:

more guidelines

Legend:

Unmodified
Added
Removed
Modified
  • coding_rules

    v2 v3  
    11
    2 == Variable Names ==
     2== General guidelines ==
     3
     4 - comment your code extensively (everybody must understand what is being done)
     5 - NEVER more than one blank line please!
     6
     7== C/C++ ==
     8
     9 - if/for should follow this:
     10{{{
     11#!c
     12for(int i=0<i<n;i++)  A[i]=i;
     13
     14if(a==0) bool=true;
     15
     16if(a==0){
     17    output=true;
     18    c=b
     19}
     20else{
     21    output=false
     22    c=a;
     23}
     24
     25for(int i=0<i<n;i++){
     26   A[i]=B[i];
     27   B[i]=0;
     28}
     29}}}
     30
     31== Matlab ==
     32
     33- All matlab routines should start with a help (Example and See Also are not mandatory):
     34{{{
     35#!m
     36function outputs=FunctionName(inputs)
     37%FUNCTIONNAME - one line description
     38%
     39%   Extensive description of what is being done, inputs
     40%   outputs, etc...
     41%
     42%   Usage:
     43%      outputs=FunctionName(inputs)
     44%
     45%   Example:
     46%      md.test=FunctionName(1);
     47%
     48%   See Also:
     49%      FunctionName2, FunctionName3, ...
     50}}}
     51
     52== Variable/Enum/Functions Names ==
    353
    454 - variables should not use capital letters. Use underscores to make variables more understandable.
    5 
    6 == Enum Names ==
    755
    856 - Function names and enums should not use any underscore. Use capital letters to make names more understandable.
     
    1361}}}
    1462
    15 == Function/Modules Names ==
    16 
    17 Functions that return an output corresponding to a given input should be named as follows:
     63 - Functions that return an output corresponding to a given input should be named as follows:
    1864   - EnumToString
    1965   - IdToName