0

Is there specific reference for naming conventions in Bitcoin Core source code?
I see regularity in class naming with prefix "C" (Chain, CInv etc.) or pointer naming with "p" (pprev, pnode etc. ) and am wondering if there's more to my list of prefixes or other conventions.

Is there a Bitcoin-specific naming convention at all?

4

http://en.wikipedia.org/wiki/Hungarian_notation

  • C stands for Class
  • p for Pointer
  • f for Flag (boolean)
  • n for Number
  • sz for zero terminated string

These conventions are no longer mandatory when contributing to bitcoin core.

You might also read https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md

| improve this answer | |
1

The style guide for Bitcoin Core is available on GitHub here. It no longer details a naming convention, but as Nick ODell already mentioned above, variables typically follow a form of Apps Hungarian naming.

In the past, the style guide did include a naming convention, however it has since been removed because it wasn't being consistently followed.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.