r/cpp • • Apr 09 '26

0xd34df00d/you-dont-know-cpp: and neither do I

https://github.com/0xd34df00d/you-dont-know-cpp

Some non trivial cpp quiz style questions

155 Upvotes

55 comments sorted by

View all comments

Show parent comment

3

u/38thTimesACharm Apr 10 '26

I don't think your last sentence follows from the rest. Newer standards aren't more obscure, they're just different. And they come with features specifically designed to avoid ambiguity and confusion, along with fixes that prevent unintuitive results.

Like the aggregate init with deleted ctor example. Allowed, surprisingly, in C++17; disallowed in C++20. That's an improvement.

That's why I don't really like articles like these. Most of this stuff just doesn't come up. People write terrible C++ code all the time, but it's overwhelmingly bad because they refuse to learn new paradigms and use ancient, risky techniques from C (raw pointers, untagged unions, uninitialized out params...) instead of modern tools.

The opposite problem, relying too much on obscure corner cases in modern standards, is so rare by comparison.

1

u/PipingSnail Apr 10 '26

By not chasing the bleeding edge we've prevented many of these things entering our code base because the compiler won't compile them. That's what that sentence meant.

I'm happy with our choice.

If you want to use the bleeding edge, good for you. I won't tell you that you're wrong. I just won't agree to make the same choice.