Skip to content

Commit 05f9770

Browse files
committed
doc: Clarify developer notes about constant naming
I'm pretty sure developer notes were intended to say constants should be upper case and variables should be lower case, but right now they are ambiguous about whether to write: ```c++ // foo.h extern const int SYMBOL; // foo.cpp const int SYMBOL = 1; ``` or: ```c++ // foo.h extern const int g_symbol; // foo.cpp const int g_symbol = 1; ``` First convention above is better than the second convention because it tells you without having to look anything up that the value of `SYMBOL` will never change at runtime. Also I've never seen any c++ project anywhere using the second convention
1 parent b3c3d9a commit 05f9770

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/developer-notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ code.
8383
separate words (snake_case).
8484
- Class member variables have a `m_` prefix.
8585
- Global variables have a `g_` prefix.
86-
- Compile-time constant names are all uppercase, and use `_` to separate words.
86+
- Constant names are all uppercase, and use `_` to separate words.
8787
- Class names, function names, and method names are UpperCamelCase
8888
(PascalCase). Do not prefix class names with `C`.
8989
- Test suite naming convention: The Boost test suite in file

0 commit comments

Comments
 (0)