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.
This commit is contained in:
Matthew Woehlke
2024-12-10 14:18:08 -05:00
parent ed0baf1ec5
commit b4704d3ef8

View File

@@ -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: