Changes between Version 45 and Version 46 of Developer/Coding/Conventions


Ignore:
Timestamp:
May 30, 2014, 5:31:01 PM (5 years ago)
Author:
Gedare
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Developer/Coding/Conventions

    v45 v46  
    3838 *  Do not use more than one blank line in a row.
    3939 *  Do not use trailing whitespace at the end of a line.
     40 *  Understand and follow the [wiki:Developer/Coding/NamingRules naming rules].
    4041= Readability =
    4142
    42  *  Do not mix variable declarations and code. Declare variables at the start of a block.
     43 *  Do not mix variable declarations and code.
     44 *  Declare variables at the start of a block.
     45 *  Only use primitive initialization of variables at their declarations. Avoid complex initializations or function calls in variable declarations.
    4346 *  Do not put unrelated functions or data in a single file.
    4447 *  Avoid deep nesting by using early returns
     
    7881
    7982TBD: add something about the dependencies and header file layering.
    80 = SuperCore Naming =
    81 
    82 SuperCore is organized in an Object-Oriented fashion. Each score Manager is a Package, or Module, and each Module contains type definitions, functions, etc. The following summarizes our conventions for using names within SuperCore Modules.
    83  *  Use "Module_name_Particular_type_name" for type names.
    84  *  Use "_Module_name_Particular_function_name" for functions names.
    85  *  Use "_Module_name_Global_or_file_scope_variable_name" for global or file scope variable names.
    86 
    87 Within a structure,
    88  *  Use "Name" for struct aggregate members.
    89  *  Use "name" for reference members.
    90  *  Use "name" for primitive type members.
    91 Example
    92 {{{
    93 typedef struct {
    94   Other_module_Struct_type    Aggregate_member_name;
    95   Other_module_Struct_type   *reference_member_name;
    96   Other_module_Primitive_type primitive_member_name;
    97 } The_module_Type_name;
    98 }}}
    99 = Exceptions to the Rules =
     83=  =Exceptions to the Rules==
    10084
    10185TBD