Skip to content

Commit dcb7f88

Browse files
anishk85ahcorde
authored andcommitted
DOC: Add note on naming convention inconsistencies (#5918)
Signed-off-by: Alejandro Hernández Cordero <[email protected]> Co-authored-by: Alejandro Hernández Cordero <[email protected]> (cherry picked from commit 8813cbc)
1 parent 144f52d commit dcb7f88

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

source/The-ROS2-Project/Contributing/Code-Style-Language-Versions.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ Variable Naming
9393
* rationale: easy to tell the scope of a variable at a glance
9494
* consistency across languages
9595

96+
* **Note on naming conventions**: ROS 2 deviates from the Google C++ Style Guide in several naming areas:
97+
98+
* The Google style guide recommends ``kPascalCase`` for constants (e.g., ``kDaysInAWeek``)
99+
* ROS 2 projects currently use a mix of ``snake_case``, ``PascalCase``, and ``UPPER_CASE`` naming conventions
100+
* This deviation is for historical reasons and consistency with existing ROS codebases
101+
* For new projects, developers should follow the existing conventions in related ROS 2 packages
102+
* When in doubt, prefer consistency with surrounding code over strict adherence to Google style
103+
96104
Function and Method Naming
97105
~~~~~~~~~~~~~~~~~~~~~~~~~~
98106

0 commit comments

Comments
 (0)