NOCL  v0.1.0-2524
Modern C++ Class Library for GUI Projects
Coding Standards

The NOCL coding standards are as follows:

  • Use 4-space TABS.
  • Line length is around 120 characters, but there is no hard limit.
  • Use Allman brace style.
  • Extensive use of Doxygen. The NOCL needs to be easy-to-use, with lots of simple examples, without having to read the entire codebase.
  • Classes use CamelCase naming convention.
  • Methods, functions, and variables use lowercase_and_underscore().
  • Prefer C++11 or newer when possible.
  • Enums use C++11 "enum class".
  • Don't be afraid to use the STL.
  • Prefer multibyte over widestring.
  • Use const everywhere you can. Learn to use const methods, const parameters, and const local variables when it makes sense.
  • Pass non-trivial types by reference.
  • Avoid pointers. Avoid Pointers! AVOID POINTERS!
  • Use std::unique_ptr when you cannot avoid pointers.
  • Avoid C++ using.
  • Use RAII.
  • Do not return error codes! Code should be free of error code handling to reduce maintenance nightmares with long if() clauses or switch statements after every API call. Throw C++ exceptions when a problem is detected, and let parent code catch the exception.
  • Originally inspired by – but definitely does not follow – the old IBM OCL classes.
  • Unintentionally though now unmistakenly tied to Gtk+. Refer to the Gtk+ hierarchy for guidance when necessary.