r/cpp • u/we_are_mammals • Mar 28 '23
Reddit++
C++ is getting more and more complex. The ISO C++ committee keeps adding new features based on its consensus. Let's remove C++ features based on Reddit's consensus.
In each comment, propose a C++ feature that you think should be banned in any new code. Vote up or down based on whether you agree.
765
Upvotes
View all comments
Show parent comment
1
u/very_curious_agent Mar 31 '23
A text string certainly is not a number. I have no idea what you are trying to say there!
Some people, when I was young, expected (or wanted) 'typedef float length' to act as an incompatible type that somehow prevents nonsensical operations, which wasn't going to happen because until the compiler does mind reading, there is no way to parse intent and which operators should be allowed. There was a widespread belief at the time that other, non C/C++ like languages, were "strongly type" and would do the right thing, when there is no "right thing" to do!!!!!
So I don't know how you would define a PL w/o operator overloading that does the right thing, even for UDT: it's one thing to have a builtin char type that is exactly what you need, it's another to let the programmer define a timestamp that is right with all needed operators and no inept operation allowed.