I once spent two months applying a new-fangled static code analyser to a mature Java/C++ based commercial product.
It was incredible the things it found, many of which absolutely shouldn't even have compiled. Others were super subtle like if statements with a semicolon after the condition, meaning the 'true' block was executed every time.
So many long-running bugs went away after that marathon cleanup. It was interesting whenever a test failed after a round of static code fixes to see how often the test was set up to pass only the wrong code and was failing now it was right.
It was incredible the things it found, many of which absolutely shouldn't even have compiled. Others were super subtle like if statements with a semicolon after the condition, meaning the 'true' block was executed every time.
then you find out it was a load bearing bug and the true block was the only code that worked 😭
This makes me think of python-juniors comparing strings as if they where enums. Pair this with having to explain in a polite and professional manner why this is bad, meanwhile "do we really need code-review?".
I spent hours trying to debug some code where a property kept being null when it turns out it was referenced as both color and colour. Never have to deal with that sort of bullshit with statically typed languages.
View all comments
1.8k
u/[deleted] Sep 25 '26
[removed] — view removed comment