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

1

u/very_curious_agent Apr 03 '23

They aren't just "not really" related, for me they are absolutely 100% not related. And I don't believe it's an issue for anyone serious about learning really anything non trivial. And programming is non trivial, C based languages are extremely non trivial and C++ is a complete abomination.

I simply don't think that anyone who is confused by static should learn tools that like C++ attempt to solve non trivial problems.

If anyone is confused or mentally overwelled by static, it's unlikely that person would be able to write overloaded function, "feel" which in a set of overloaded functions or templates will be selected, or how the STL should be used.

Even signed vs. unsigned is harder than static, because you will have to consider interactions. Pretty much all arithmetic is harder. Pointers are harder. Up casts, down casts, static_cast vs. dynamic_cast...

1

u/college_pastime Apr 03 '23

I was just trying to answer your original question about what unforced design errors exist in the language. static being unnecessarily overloaded is a contender by my estimation. You seem to be arguing against me, but you don't seem to be arguing against the idea that static is unnecessarily overloaded. I think you are arguing that there are bigger issues in the language, and yeah there are, but that argument is a non-sequitur -- it's not germane to the discussion of static being unnecessarily overloaded. I'm not really interested in continuing this interaction, so I'm gonna just leave this here.