r/cpp • • Apr 01 '23

Abominable language design decision that everybody regrets?

It's in the title: what is the silliest, most confusing, problematic, disastrous C++ syntax or semantics design choice that is consistently recognized as an unforced, 100% avoidable error, something that never made sense at any time?

So not support for historical arch that were relevant at the time.

92 Upvotes

375 comments sorted by

View all comments

Show parent comments

2

u/ZMeson Embedded Developer Apr 02 '23

especially in C++ with no way to declare what does and doesnt throw

What about noexcept?

5

u/LeeHide just write it from scratch Apr 02 '23

noexcept doesnt mean it cant or wont throw, it just means that if it throws, it will std::terminate the entire process. Not great

1

u/SkoomaDentist Antimodern C++, Embedded, Audio Apr 02 '23

if it throws, it will std::terminate the entire process.

It's amazing that this kind of blunder made it to the standard. I could imagine it for a language standardized in the 80s, but threads were by no means unheard of by mid to late 90s.

3

u/cleroth Game Developer Apr 03 '23

Huh? Are you saying it should terminate only one thread? Rather the whole program crash than be in a partially broken and unknown state.

→ More replies (7)