Merge bitcoin/bitcoin#35698: doc: Update enum class constant naming style guide

fad5809cb9 doc: Update enum class constant naming style guide (MarcoFalke)

Pull request description:

  Lately, it seems there are frequent scripted-diffs and refactors to rename ALL_CAPS enum class constant names to something else, due to third-party macro clashes. E.g.:

  * https://github.com/bitcoin/bitcoin/pull/35588
  * https://github.com/bitcoin/bitcoin/pull/35487
  * https://github.com/bitcoin/bitcoin/pull/34454
  * etc... (not listing the intermittent pull request force pushes that lead to early CI failures due to macro clashes)

  Try to steer away from ALL_CAPS here by discouraging it in new code.

ACKs for top commit:
  kevkevinpal:
    ACK [fad5809](fad5809cb9)
  hebasto:
    ACK fad5809cb9.
  pablomartin4btc:
    ACK fad5809cb9
  stickies-v:
    ACK fad5809cb9
  yuvicc:
    ACK fad5809cb9
  musaHaruna:
    ACK [fad5809](fad5809cb9)
  janb84:
     ACK fad5809cb9

Tree-SHA512: f652c0127022a5ea131e956aef0a2d8c98f4c4317519475a38e5f527a5f672b93a8e51743c1a588f38ddc795531168b68ab68f86471b61f25229761eff0f3879
This commit is contained in:
merge-script
2026-07-13 14:54:10 +01:00

View File

@@ -40,10 +40,10 @@ code.
- Class member variables have a `m_` prefix.
- Global variables have a `g_` prefix.
- Constant names are all uppercase, and use `_` to separate words.
- Enumerator constants may be `snake_case`, `PascalCase` or `ALL_CAPS`.
This is a more tolerant policy than the [C++ Core
- Enumerator constants may be `snake_case`, or `PascalCase`. They should not
be `ALL_CAPS`, according to the [C++ Core
Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#renum-caps),
which recommend using `snake_case`. Please use what seems appropriate.
to avoid clashing with macros.
- Class names, function names, and method names are UpperCamelCase
(PascalCase). Do not prefix class names with `C`. See [Internal interface
naming style](#internal-interface-naming-style) for an exception to this