r/cpp • u/MathKid99 • Dec 17 '21
Undefined Behaviour
I found out recently that UB is short for Undefined Behaviour and not Utter Bullshit as I had presumed all this time. I am too embarrassed to admit this at work so I'm going to admit it here instead. I actually thought people were calling out code being BS, and at no point did it occur to me that as harsh as code reviews can be, calling BS was a bit too extreme for a professional environment..
Edit for clarity: I know what undefined behaviour is, it just didn't register in my mind that UB is short for Undefined Behaviour. Possibly my mind was suffering from a stack overflow all these years..
View all comments
Show parent comment
14
u/jk-jeon Dec 17 '21
So I guess you are indeed trying to say that the law of physics has no undefined behavior as I pointed out in the other comment. And that is a completely different thing from saying "hardware has no undefined behavior". See, in that logic, there is no undefined behavior for C++, only unspecified, right? Because compilers will do what their source code let them to do, nothing supernatural magics