doc: Developer Notes don’t give advice on initialisms in class/function/method names #32698

issue JeremyRand openend this issue on June 7, 2025
  1. JeremyRand commented at 9:10 am on June 7, 2025: contributor

    Please describe the feature you’d like to see added.

    The developer notes say that class/function/method names in newly added code should be UpperCamelCase:

    https://github.com/bitcoin/bitcoin/blob/e2174378aa8a339c7be8b4e91311513ed520a16d/doc/developer-notes.md?plain=1#L98-L99

    However, no recommendation is given for initialisms in class/function/method names. Searching DuckDuckGo for “camelcase” indicates a general consensus that the term “CamelCase” does not imply any particular policy here.

    The existing codebase (unsurprisingly) is inconsistent here. For example, HtmlEscape and JSONRPCRequest both show up.

    https://github.com/bitcoin/bitcoin/blob/e2174378aa8a339c7be8b4e91311513ed520a16d/src/qt/guiutil.h#L89 https://github.com/bitcoin/bitcoin/blob/e2174378aa8a339c7be8b4e91311513ed520a16d/src/wallet/rpc/util.h#L17

    When writing new code for Bitcoin Core, developers don’t know what style to use regarding initialisms. This produces unnecessary confusion, which is exacerbated when they grep the source code and find a mix of styles.

    Describe the solution you’d like

    It would be nice if the developer notes could be updated to clarify this. (I do not particularly care what the policy should be, I would just like some policy to be there, so that developers know what’s expected and the codebase can eventually converge toward a consistent style.)

    Describe any alternatives you’ve considered

    I guess the developer notes could be updated to instead say that there is no recommendation, and it’s up to whichever developer is submitting the PR. This seems undesirable, since it means the codebase will never gain a more consistent style.

    Please leave any additional context

    No response

  2. JeremyRand added the label Feature on Jun 7, 2025
  3. JeremyRand renamed this:
    Developer Notes don't give advice on initialisms in class/function/method names
    doc: Developer Notes don't give advice on initialisms in class/function/method names
    on Jun 7, 2025
  4. maflcko added the label Docs on Jun 7, 2025
  5. maflcko removed the label Feature on Jun 7, 2025
  6. Muniru0 commented at 10:25 pm on June 7, 2025: none

    @JeremyRand that is a sound point to make. The screaming/acronym caps I believe have being used to kind of draw attention to major acronyms in the codebase like RPC and JSON. I will jump on to fix it by proposing the use of UpperCamelCase in the developer notes as already stated and further clarifying that :

    Both class names like: JSONRPCRequest and HtmlEscape should become JsonRpcRequest and HtmlEscape.

  7. yuvicc commented at 1:47 pm on June 8, 2025: contributor

    I will jump on to fix it by proposing the use of UpperCamelCase in the developer notes as already stated and further clarifying that :

    ACK on this, it would be helpful for the new contributors.

    Both class names like: JSONRPCRequest and HtmlEscape should become JsonRpcRequest and HtmlEscape.

    We shall not open a PR for a typo but can be updated when we touch the codebase in future.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-06-15 06:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me