There is no better feeling on Earth than replacing a buggy, complicated, difficult to follow piece of code (which caused you untold pain six months ago as you spent weeks tweaking it into a superficially-working state) with an easy to follow solution, created in a day and a half, which is obviously and testably correct.

It’s like discovering that you’re one of those mythical superprogrammers, 10x more efficient than the “average programmer”, because the average programmer was you, six months ago. You might think that the comparison isn’t valid because I solved the problem once already, but the problem itself didn’t get any simpler, and my understanding of it only got significantly better once I sat down yesterday to understand what it was that I really needed to do. Even now I’d argue that the understanding of the problem that I have in my head isn’t really much better than it used to be; it’s the understanding I have on paper that’s clearly organized and checkable against my solution.

Solving problems isn’t about thinking really hard and hoping the solution that magically comes to you is close enough to being right that you can tweak it into something that works. It’s about organizing your understanding of the problem. When there are a finite number of cases, make sure you understand each one. I’d say more on this topic, but this is about all the blog post I have time for.

Leave a Reply