Skip to content

C++

You will find here some libraries and tips concerning C++.

Guidelines

Following the Python Guidelines, C++ definitions are as follow :

  • use camelCase for public functions names
  • use _camelCase for protected and private functions names
  • use snake_case for variables names
  • use _snake_case for protected and private variables names
  • use ALL_CAPS for constant names or #define
  • use CapWords for class names
  • no special representation is used for abstract classes

Documentation

  • The C++ documentation is based on Doxygen .
  • Most IDE and smart editors can automatically prepare the canvas while typing /** followed by a new line.
  • Each function must be documented with at least those lines (parameters and return fields depend on if they exist in the actual function) :

/**
    * @brief What does my function do ?
    * @param param_name what is this parameter used for ?
    * @return What will we return ?
    */
bool doSomething(bool param_name);

/**
    * @ brief Nude function without return nor parameters that does nothing
    */
void doNothing();
* A lot of other fields can be used to describe the functions in more detail, and even document the current file. * Following the same principle, the variables can be documented too !
  • Afterward, you can use IDE-integrated or Doxygen standalone to generate the HTML documentation.
  • Another advantage : Doxygen is able to draw the dependencies graphs automatically thanks to graphviz !

Referenced C++ samples