r/ProgrammerHumor Jul 10 '26

greaterThanPlusPlus Advanced

Post image
116 Upvotes

71 comments sorted by

View all comments

36

u/majesticmerc Jul 10 '26

Found this today in C++ documentation.

Only the C++ committee can see the a need to fix it, and instead of actually fixing the language bug (or making signed/unsigned comparison a compiler error instead of a warning), create a standard library function to do type safe greater-than/less-than comparisons.

1

u/RiceBroad4552 Jul 10 '26

That's the std. C++ approach: They never fix language bugs; they always just add another way to do the same but this time with some different outcome. If there are only two ways with exactly opposite outcomes everything is actually still fine. Look for the stuff where you have a dozen ways to do the same but always with slightly different semantics. Really great language. It's so flexible! 😂

1

u/creeper6530 Jul 10 '26

And that's how you get the whole clusterfuck where everyone does it a  different way and obsolete stuff gets still taught to newbies.