6

It's part of the developer notes in the documentation of Bitcoin Core:

Class names, function names, and method names are UpperCamelCase (PascalCase). Do not prefix class names with C. See Internal interface naming style for an exception to this convention.

Link

But I've seen many places in the codebase classes' name starting by C. Such as:

  • CBlock
  • CTransaction
  • CTxIn
  • CTxOut
  • COutPoint

And many other examples. Is there a progress currently for changing these names? Or this rule is not apply to some classes?

Note that there's no description for this inconsistency in this part of the doc.

1

1 Answer 1

12

These classes predate the coding style guidelines. Guidelines are a recommendation for newly added code and refactoring patches for the purpose of only changing the coding style are discouraged.

In the plain words of the introduction of the document you link:

Various coding styles have been used during the history of the codebase, and the result is not very consistent. However, we're now trying to converge to a single style, which is specified below. When writing patches, favor the new style over attempting to mimic the surrounding style, except for move-only commits.

Do not submit patches solely to modify the style of existing code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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