Programming Style

  • use tabs for indentation, tab width is 4
  • do not exceed a line width of 80 characters
  • curly brackets follow on a new line (Allman style), except for structs and enums
  • always explicitly define a block after if/else with curly brackets
  • empty lines should not contain any whitespace
  • add a space between variables and operators
  • add a space between if/while and opening bracket
  • no space between function name and opening bracket
  • add a space after a comma, as in natural language
  • structs/enums are typedef'd with the same name
  • defined types have a _t suffix
  • no C++ style comments //
  • add the comment in a separate line, above the statement you are commenting
  • declare variables at the beginning of the block
  • function/member declarations use a Doxygen /** comment */
  • use @ as the Doxygen escape character (not \)