Skip to content

Coding rules

General Rules

  1. Code and comments must be written in English.
  2. Code must be written in C/C++.
  3. Every function/method except main() must have a doxygen comment above.
  4. Comments must be written above the code descripted.
  5. Pre-defined values must be defined using #define.
  6. DEFINE macros must be written in capital letters.
  7. All variables in classes must be protected or private, if possible.

Naming Rules

General

  • Spaces are written as underscores _.

Functions

  • First letter must be written in Capital

Variables

  • Capital letters must not be used.
  • int variables must start with i_.
  • long variables must start with l_.
  • long long variables must start with ll_.
  • uint8_t variables must start with u8_.
  • uint16_t variables must start with u16_.
  • uint32_t variables must start with u32_.
  • uint64_t variables must start with u64_.
  • bool variables must start with bool_.
  • float variables must start with fl_.
  • char variables must start with ch_.
  • strings must start with str_.
  • vectors must start with vec_.
  • enum variables must start with en_.
  • transfer parameters begin with an underscore _ in addition to the above.
  • Variables of a typedef start with the starting letters of the originating type listed above.

Classes

  • classes must start with cla_.
  • objects created from a class must start with obj_