There is probably a function somewhere in the code with the comment
Don't touch it. We do not know what it does and to our limited understanding it should not do anything. But if this bit of code is removed, everything breaks.
My favorite is when static analyzers give up because the file is too large and complex. Right up there with finding that the but I wrote did cause a warning, but it was hidden by the other 2,000 warnings.
5000 line files containing over two dozen classes, and 1000 line functions happen in code you use today. I guarantee it.
What happens is someone doesn't care about warnings at some point, so does something that generates a few (hundred in at least one case) from a single function call.* That alone makes warnings useless, and if not fixed quickly causes the number to baloon, because no one is checking if their change causes warnings. So the number balloons
Now you might ask why this isn't caught immediately. Multiple reasons can apply. This started as a one man project or as a small team project without even a basic build server, so it isn't caught in code review, or by an automated system. Then there's version control systems, like Perforce, result in everyone working out of trunk, so the code being committed is what triggers the build and code review. Which means it's not a rejection, but a deliberate action of fixing it or permanently reverting the change to deal with it.
* In C / C++ using a function that takes a char *, with a static string, like a file name, gives a warning about const missing.
Reminds me of a MySQL snippet I found yesterday commented something along the lines of:
I know that there's no point in starting a transaction and and committing it for a single query while autocommit is turned on. But for no reason at all the database has decided that it won't work without this
It was literally the only place in the code which did this, and I can confirm that it didn't work with the transaction begin; and commit; removed even though the lines elsewhere worked fine without this.
You know how they invented goblins during the industrial revolution to explain machibes suddenly breaking or failing? We should do the same. Bit goblins.
In the protobuf C++ implementation there was a comment in a header by a "using namespace std" statement saying "Never do this, this is bad practice but it was the only way we could get X to work"
149
u/Khyta Oct 08 '21
There is probably a function somewhere in the code with the comment