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.

192 Upvotes

100 comments sorted by

View all comments

Show parent comment

5

u/38thTimesACharm Mar 18 '26

Not OP but to me, portability and compatibility are different things. I would say needing to support old versions is a compatibility problem, while a portability problem would be relying on GNU extensions or assuming UTF-8.

2

u/yuri-kilochek Mar 18 '26 edited Mar 18 '26

How is a GNU extension different from a new standard feature? Both limit where you can build your code, and both can be resolved by either modifying the code to not use them or getting a compiler that supports them.

4

u/Serious-Regular Mar 18 '26 edited Mar 18 '26

Both limit where you can build your code

Portable code means it compiles for multiple targets not that it compiles on multiple targets. Like lemme ask you: do you think people doing embedded dev are compiling on the microcontrollers themselves.............?