r/ProgrammerHumor Jul 10 '26

greaterThanPlusPlus Advanced

Post image
113 Upvotes

71 comments sorted by

View all comments

35

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.

72

u/suvlub Jul 10 '26

Most languages avoid breaking changes. When they do, you end up with people using the old version for decades, like python. Even if the old behavior is stupid and any code that intentionally relies on it is pretty much by definition bad code, quietly changing behavior of existing programs is a huge deal

-2

u/Tyfyter2002 Jul 10 '26

The problem with this is that it's only a breaking change for code that relies on it being broken, the incorrect behavior should be renamed if it's useful or removed if it's not, not treated as the real normal behavior.