wiki
Getting startedGuidesFAQ
1.0.0
1.0.0
  • b-it-bots wiki
  • @home
    • Getting started
      • First steps
      • Setting up your development environment
        • Configuring your editor
        • Using ssh
      • Adding your first contribution
    • Tutorials
      • Architecture
    • Guides
      • git
        • Making good commits
        • Branching model
        • Adding git aliases to make your life easier
        • Creating a release
      • SSH
      • ROS
        • Creating a new package
          • Creating a new node
        • Creating a new message, service or action
        • Testing in ROS
        • Linting
      • Coding conventions
        • C++
        • Python
      • Toolkit
        • CLion
        • Atom configuration
        • Using vim
        • TMUX - Terminal Multiplexer
    • Resources
    • FAQ
      • git
  • @work
    • 2018-05-06-navigation-atwork
    • 2018-05-06-simulation_mapping
    • How to use the RealSense2 camera
    • Getting the classifier from a data set
Powered by GitBook
On this page
  • Filenames
  • Class Names
  • Function Names
  • Variable Names

Was this helpful?

  1. @home
  2. Guides
  3. Coding conventions

C++

PreviousCoding conventionsNextPython

Last updated 4 years ago

Was this helpful?

Make sure that your text editor is properly configured to use spaces instead of tabs.

Filenames

Filenames should be all lowercase and words are separated by underscores ( _ ). For instance:

whole_body_controller.cpp
whole_body_controller.h

Class Names

Class names should be nouns in , i.e. the first letter of every word capitalised. Use whole words and avoid acronyms or abbreviations (unless the abbreviation is much more widely used than the long form, such as SVM or ROS).

Function Names

Regular functions have mixed case. The first word (which is usually a verb) starts with lowercase and the remaining words follow the practice. For instance:

getEuclideanDistance2d ( double x1 , double y1 , double x2 , double y2 )

Variable Names

Variable names are all lowercase, with underscores between words. Class member variables have trailing underscores. For instance:

double current_velocity_joint_1 = 0 . 0 ; // non member class variable
double current_velocity_joint_1_ = 0 . 0 ; // member class variable
UpperCamelCase
CamelCase