Coding styles

From Wiki for iCub and Friends
Jump to navigation Jump to search

As far as coding is concerned we provide a couple of strong requirements and a few guidelines.

Strong requirements

  • Make sure your code compiles on both Linux and Windows, with the supported compilers (see Section 8 -- Software, dependencies of the manual). To achieve this, you should make sure you only use C/C++ features that defined in the ANSI standard.
  • Use spaces instead of tabs to indent your code, use 4 spaces instead of 3. To do this you have to configure your editor accordingly (instructions vary depending on the editor).
  • Append an empty line at the end of each file to keep gcc happy


RobotCub coding guidelines are defined in Section III of RobotCub Deliverable 8.2.

For convenience, they are reported here:

Please take the time to read through the three documents.

As we move towards the creation of a release version of the iCub software, we will begin to enforce a sub-set of these guidelines as mandatory standards. The current set of standards is set out in iCub Software Standards. Ultimately, all modules to be included in the standard iCub release version will have to comply with these standards.