4 ms·
The right answer to all this questions is: "Nobody in their right mind should use code like this in production". You should avoid code like this at all cost.
by pipio21 10y ago
The right answer to all this questions is:
"Nobody in their right mind should use code like this in production".
You should avoid code like this at all cost. If you want to use this code because you feel smarter, you will be creating enormous amount of problems in the future and you are actually dumb.
The way to win the game is not playing it. Specially if you are programming nuclear plants.
If you see this code what you have to do is replace it, not understand it. It works today but when you change the compiler or the architecture 10 years from now, it will be such a huge pain in the ass to find all the bugs and undefined behavior it creates.
- HelloNurse 10y agoAnd the key to not playing this undefined behaviour game is using integers of known size. C has them since C99, so using int, short, char etc. like in the article is reckless and inexcusable.