Skip to content

CPP Writing Guidelines

Evan McLaughlin edited this page Jul 3, 2019 · 21 revisions

Our general rules:

Headers

Naming Conventions

  • All C++ variables are named with lower case, and underscores between words (e.g., variable_name)
  • For private member variables, add an extra underscore at the end of the variable (e.g., private_variable_name_)
  • We generally like to access member variables using functions (e.g., GetVariableA(){return A_}). However, you may want to be able to access the member variables for your specific application. For example, point clouds may contain many variables that you often need to access, so in this case you can use public member variables (similar to PCL). For public member variables, do not use an underscore at the end of the variable
  • Functions should be named using uppercase letters for each word (e.g., PerformAction())

More Information

If we don't have our own rule, try to stick to the google C++ guide which can be found here:

Clone this wiki locally