Skip to content
Siddharth Kannan edited this page Jan 10, 2016 · 1 revision

Naming

  • Camelcased - Name starts with a capital letter, with each word starting with a capital letter and no underscores.

  • camelCased – Starting with a small letter but all other words starts with a capital letter

  • under_scored - all letters in capital separated by underscores.

  • ALL_CAPITALS – all letters in capital separated by underscores.


Use Of Naming Types

  1. UnderScore
  • Packages , topics and services, message fields
    for e.g. mission_planner , buoy_detection
  • File names (be descriptive)
    for e.g. action_server.h
  • Libraries (don’t insert underscore just after lib prefix)
    for e.g. libmy_great_thing
  • Arguments of functions
    for e.g. example_arg
  • Variable names
    for e.g. var_name
  • Class data members with a trailing underscore added
    for e.g. final_image_
  • Global variables with leading g_ added
    for e.g. g_min , g_max
  • Namespace names
  1. CamelCased
  • Class names and other typenames like struct, typedef, enums
    for e.g. ExampleClass
  • Message file name
    for e.g. DetectGate
  1. camelCased
  • Function and class method names
    for e.g. exampleMethod
  1. ALL_CAPITALS
  • constants
    for e.g. MIN , MAX

ROS Convention
CppStyleGuide