Comment

Comment by sillysaurusx

I happen to agree, but only in this special case. Normally a giant switch statement is a pain to work through if there's even a tiny amount of logic involved.

One hilarious case was at Scottrade. I was poking around their C++ codebase one day and to my amazed horror saw a file hundreds of lines long, and a big chunk of it was devoted to handling leap years. Like, every leap year, one at a time.

There are few enough leap years that it should in theory be difficult to write hundreds of lines of code to handle each of them, but some contractor managed to.

And so the ball of mud continued. What can you do but laugh and embrace the horror?

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton