From ff376dbbc64955b28d8238a50be8300868d90bd7 Mon Sep 17 00:00:00 2001 From: Anish Kumar Date: Mon, 13 Oct 2025 12:55:27 +0530 Subject: [PATCH] DOC: Add note on naming convention inconsistencies (#5918) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero Co-authored-by: Alejandro Hernández Cordero (cherry picked from commit 8813cbc202c4a0c7cb3d81bb44b1243cda70af40) --- .../Contributing/Code-Style-Language-Versions.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/The-ROS2-Project/Contributing/Code-Style-Language-Versions.rst b/source/The-ROS2-Project/Contributing/Code-Style-Language-Versions.rst index 0f41c405d7..1daabd49a6 100644 --- a/source/The-ROS2-Project/Contributing/Code-Style-Language-Versions.rst +++ b/source/The-ROS2-Project/Contributing/Code-Style-Language-Versions.rst @@ -93,6 +93,14 @@ Variable Naming * rationale: easy to tell the scope of a variable at a glance * consistency across languages +* **Note on naming conventions**: ROS 2 deviates from the Google C++ Style Guide in several naming areas: + + * The Google style guide recommends ``kPascalCase`` for constants (e.g., ``kDaysInAWeek``) + * ROS 2 projects currently use a mix of ``snake_case``, ``PascalCase``, and ``UPPER_CASE`` naming conventions + * This deviation is for historical reasons and consistency with existing ROS codebases + * For new projects, developers should follow the existing conventions in related ROS 2 packages + * When in doubt, prefer consistency with surrounding code over strict adherence to Google style + Function and Method Naming ~~~~~~~~~~~~~~~~~~~~~~~~~~