News for hackers. Stuff that matters.
Re:Special Cases Are a Code Smell by westoncb on Thursday January 24, 2019 @11:55PM (#18995674)
> Rejiggering an algorithm so as not to have special cases just puts cognitive load on whoever reads the code to suss out what the original algorithm was.

Sometimes that's how it goes, but other times the special cases were a result of just not knowing the original problem well enough to think of a clean solution that really captures its essence, and the special cases are evidence of a sort of resultant duct taping.

Agreed though, what you're describing definitely happens and I'm not a fan.

There are no comments on this comment yet.