1
0
Эх сурвалжийг харах

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.
Matthew Woehlke 10 сар өмнө
parent
commit
b4704d3ef8
1 өөрчлөгдсөн 4 нэмэгдсэн , 8 устгасан
  1. 4 8
      Help/dev/source.rst

+ 4 - 8
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: