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 comment

1

u/OlivierTwist Mar 18 '26

You know, C++ is backward compatible, so exactly zero people care if public headers are C++17 or C++26.

As long as headers can be used on a target system everyone is happy.

3

u/Conscious_Support176 Mar 19 '26

That’s an interesting argument. Customers won’t care if you’re using C89 either, right?

2

u/OlivierTwist Mar 19 '26

Absolutely correct. As long as API is structurally logical, consistent and user friendly they absolutely don't care what you are using under the hood.

0

u/Conscious_Support176 Mar 19 '26

While that’s true, it’s also meaningless. It ignores the reasons why we don’t simply write everyone K&R C.

1

u/OlivierTwist Mar 19 '26

You are mixing API/headers and code. You can write in C++26 and expose C89 headers.

1

u/Conscious_Support176 Mar 19 '26

On. Headers are also code. I think you mean that I am mixing up declarations with definitions.

I am not. I’m suggesting that caveats about being logical, consistent and user friendly sweeps a lot under the carpet. If the evolution of C++ allows you to create more logical, consistent and friendly declarations, users will care about that.