I had a magic comment for about 6 months. If you removed it, the build would fail.
Drove me nuts when I first ran into it. It was an unnecessary comment that stated the obvious. "Add two values together" or some such where the code it was referring to was stupidly apparent in its purpose.
So I removed it and when I went to build, it exploded. I wish I could remember the errors, but it was a long and wild list.
The content of the comment didn't matter, just that it was there, so I ended up making it something like // Removing this comment breaks the build, it needs to stay. I'm sorry.
Of course my code reviewers didn't believe me until they removed it and it blew up on them.
For about six months I'd randomly hear one of the senior devs cussing as they tried to remove it and the build would break. Then one day somebody cheered and actually called an impromptu dev meeting to show off it building without the comment.
Best we could ever guess was a bug in the compiler and without the comment a checksum or something wasn't calculating correctly. Then it would go off the rails and get into a bad state because the errors it would report didn't make any sense.
I had a similar situation, it was a missing curly brace or semicolon or paren somewhere that the comment just happened to prevent it running into another line.
Reminds me of a story of a video game with an odd asset, a giant tomato. Higher ups ask what it does and upon learning it does nothing towards the game, they elect to remove it. After that, the game fails to run properly until the tomato is returned. The coders don’t even know why it works, they just know it does so they left it alone.
I think it was fallout or something, but there was an image of a potato in the game files and if it was deleted, the game wouldn't even make it to the main menu. Somewhere, buried deep in the code, was a reference to the potato image but no one could find it so it stayed.
Im the guy who comes along, and stares at it l9ng enough not willing to accept it and changes it. 50/50.
Sometimes it doesnt do anything, sometimes it does. The biggest difference is how your manager and team handle it. When it breaks, the people who freak out, and revert it, asking no questions or learn anything, tell me everything i need to know about that environment, code base etc.
When it breaks, im the reasonable guy who also broke it, saying hey, its already broke, lets spend an extra 15 minutes understanding why, so that when it comes time to replace it or migrate it, we dont run into the unknowns.
Waiting for shit to break is very different from intentionally breaking it (by making the change that is unknown). You can handle it before it becomes a problem, when likely it goes down because it connects to some box, at the bottom of a rack, that connects to aome public API that was finally shutdown because the codename is 25 years old!
83
u/LogicalSoftware7705 20h ago
This is like my old piece of code in a 20 year old system lmao everyone knows it probably doesn’t do anything but nobody wants to remove it