this post was submitted on 13 Nov 2024
794 points (99.5% liked)
Programmer Humor
19746 readers
125 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
// This line does nothing, however removing it causes production to crash. DO NOT REMOVE
I love hitting these things in the real world. Not the big, but the comment. You just know someone spent a fortune in time and company resources to never solve the problem and their frustration level was ragequit. But then something stupid like adding
while (0){};
Suddenly made it work and they were like, fuckit.
Usually it's a bug somewhere in a compiler trying to over optimize or something and putting the line in there caused the optimization not to happen or something. Black magic.
The downside is that the compiler bug probably gets fixed, and then decades later the comment and line are still there...
The real world case I remember also included a TODO to return and fix the code later. In a published scientific software. I wonder how many paper were messed up by this buggy software. As I looked at the code due to the amount of bugs I encountered.
It's been many years from publication, and to the surprise of no one, they did not return to fix it.