It feels to me that just writing somewhere in some documentation "this is undefined behaviour" is also bad imho, which is one of my biggest grips with C++. So many "undefined behaviour"s that were left that way for "performance", instead of properly addressing/closing them. It's like laying out a minefield for a new programmer, and telling them that the map for the location of the mines is in a hut 300m away from the minefield. And when they step on a mine you scold them and tell them the mine was clearly documented on the map in the hut.
View all comments
Show parent comment
2
u/No-Information-2571 10d ago
"this is undefined behavior" is a fancy way of saying it might break on a different compiler, platform, or just when used in an unintended way.
Relying on undefined behavior is very bad.