3 ms·
A function that consisted of a giant switch statement, with each case consisting of another switch statement. Half of the sub-cases contained GOTO statements ba
by thejteam 12y ago
A function that consisted of a giant switch statement, with each case consisting of another switch statement. Half of the sub-cases contained GOTO statements back to the top of the function.
Even worse... I wrote the code. It was 2am, I had been working for 18 hours straight to get everything ready for a demo the next morning.
Even worse than that... the code worked so management wouldn't let me change it. I tried my best to find an edge case it wouldn't handle but never could. So the code shipped.
- JoachimSchipper 12y agoIf that's the worst, that's not too bad - I mean, it's ugly, but apparently it works well. ;-)