-
Notifications
You must be signed in to change notification settings - Fork 58
CPP Style Guide
Siddharth Kannan edited this page Jan 10, 2016
·
1 revision
-
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.
- 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
- CamelCased
- Class names and other typenames like struct, typedef, enums
for e.g. ExampleClass - Message file name
for e.g. DetectGate
- camelCased
- Function and class method names
for e.g. exampleMethod
- ALL_CAPITALS
- constants
for e.g. MIN , MAX