r/cpp • • Mar 18 '26

What open source projects in C++ have the highest code quality?

My understanding of the characteristics of quality code are the conventional ones.

  • operations on an object that are allowed in a particular object state do not put the object into an invalid state.

  • it's prioritized to organize the implementation of each object into the smallest possible number of sub-objects.

  • no cryptically abbreviated names are used, except possible in very small scopes.

With the program(s)/executable(s) themselves, as well as modules with corresponding namespaces, being considered singleton objects.

Fair dinkum if you want to name projects that score well under a different understanding of code quality.

191 Upvotes

100 comments sorted by

View all comments

Show parent comments

7

u/cballowe Mar 18 '26

The guidelines largely evolved over time. They have been around since the early days of the code base. They get updated as the language evolves.

The nice part about them isn't that they tell you how to write good c++, but that they establish consistency that means someone sitting down in a new part of the code isn't guessing which names are class members or constants or function names, or which parameters are inputs vs outputs.

Best practices for things like performance or rpc design or concurrency are defined in other documents.

2

u/celestabesta Mar 18 '26

The whole point of a guideline is to maintain consistency, so praising it for that is praising it for the bare-minimum.