CodingStyle

From OpenCity

Following the CodingStyle makes the program codes more consistent and more readable.


General rules

  1. 80th column limit.
  2. 40 lines method/function's body limit.
  3. The "defines" are CAPITALIZED, and prefixed with "OC_"
  4. The "enum" types are prefixed with "OPENCITY_"
  5. There is one horizontal line which separates a function from another
  6. Doxygen things when it's useful
  7. The tab size is 4 spaces
  8. Comments should be written with a lower indentation level than the concerned codes.
  9. Each class "MyClass" should have "MyClass.h" and "MyClass.cpp" files


Class' member rules

  1. Each private member method's name will be prefixed by the class name. For example: all the private methods of the class "City" will have their names beginning with "city".
  2. Each member variable name starts by the "m" character


References

Personal tools