From b4704d3ef834905ff486116f18792eb698f7fc01 Mon Sep 17 00:00:00 2001 From: Matthew Woehlke Date: Tue, 10 Dec 2024 14:18:08 -0500 Subject: [PATCH] Help/dev: Improve coding conventions guide Improve the coding conventions specified in our source code guide: - Recommend capitalization for locals as well as members. - Remove exceptions for `const` placement; new code should always prefer "east" style. - Remove separate section; "Code Style" and "Code Conventions" are similar enough to not need to make a distinction. --- Help/dev/source.rst | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Help/dev/source.rst b/Help/dev/source.rst index 039a211abc..6bacd09420 100644 --- a/Help/dev/source.rst +++ b/Help/dev/source.rst @@ -20,20 +20,16 @@ format only a subset of files, such as those that are locally modified. .. _`.clang-format`: ../../.clang-format .. _`Utilities/Scripts/clang-format.bash`: ../../Utilities/Scripts/clang-format.bash -C++ Code Conventions -==================== +In addition, we have a few coding conventions that we prefer for new code to +follow (which are not enforced by other tooling): -We loosely follow a few coding conventions: +* Name local variables using ``camelCase``. -* Name class members using ``CamelCase``. +* Name class members and free functions using ``PascalCase``. * Reference class members using ``this->Member``. * Use east ``const`` style, e.g., ``int const`` instead of ``const int``. - Exceptions: - - * C strings: ``const char*`` - * Global constants: ``static const ...`` * Declare variables using a locally-specified type: