========================== NEPTUNER Coding Guidelines - sonofdelphi 2009-12-13 2008-12-16 ========================== * To enable faster coding with an IDE * To enable better debugging, no guessing what a variable is! Variable naming ================ Variables are named as: Scope Modifier * Member variables start with m_ * Global variables start with g_ * Function Parameters start with "in_" * Local variables don't have a scope modifier Indirection Modifier * Pointer variables start with p * Reference variables start with r * Other variables don't have an indirection modifier Aggregation Modifier * a - aggregates (arrays, vectors, lists etc) * Plain variables don't have an aggregation modifier Usage Modifier * n - used for counting * s - used as string * c - character * b - used as boolean * f - used as a function. Deprecated though. * e - enumeration types * x - other structs, x = Complex = non-simple * Other types (what are they?:-) don't have a usage modifier. Indentation ============= * Use a single indent for every {} block. * { and } should be on new lines, at the same indentation level as the conditional. Eg: if(someCondition) { statement1; statement2; } * Single line conditionals need not have {} marking. But make sure you indent the single statement. Type naming ============= * Follow TitleCasing for user-defined types - classes, structs, enums. Eg: class Student { string m_sName; int m_nMarks; }; Function naming ================ * Functions should follow camelCase. * The first word of a function should be a verb. Eg: doSomeThing() Pseudoclass functions ====================== * For C-style module functions, name as ModuleName_ Eg: Neptuner_addStuff