The Pursuit for Perfect Code

Oct 16, 2020

One day, I was bored and wanted to learn a specific library. To learn this library, I had the idea to make an io-style tic-tac-toe game where friends can play tic-tac-toe with each other by just sending them a link. This was simple enough, I could have done it in an evening. I started to work on it, and it was going well. 3 days past, I was still working on it. Then 7 days past, I scrapped it and rebuilt it. And keep in mind, I could have gotten a working version done in no time. So what's the deal? I was obsessively pursuing "perfect code." Every time I had something working, I would remake it because It wasn't just right: this type shouldn't be necessary, this shouldn't have duplicate state, etc. This wasn't just tic-tac-toe, this was my Mona Lisa. If someone were to look at my code, I wanted them to be astonished at the beauty of it. And, of course, since this was a side project, as we all do, I lost steam, and the project was put on the shelf.

This is just one of the many stories of me pursuing "perfect code" at the cost of the actual product. Of course, I know I should just get an MVP then refactor to make it maintainable, and I do in important projects, but I just can't help it with my side projects. However, I'm not sure exactly if there is anything wrong with this habit. I did learn the library. But I will say that it would be nice to have a giant list of fully completed projects that would look just wonderful on a resume.

I think this habit arose from me reading, and I still do, a whole bunch of articles and books on "the best coding practices you need to know!!!" So whenever I'm making something, my brain goes through the hundreds of articles, methodologies, and ideas and screams "my schema allows invalid states!", "this method shouldn't have to be aware of stuff outside of its domain!", "these domain boundaries are too gray!" I can see everything that's wrong with my code. One big problem that often occurs is that these methodologies can't coexist. I have to choose one over the other. I could just stick to one and move on, or, even better, I could spend countless hours and hours trying to make it perfect, so I don't have to comment this one line of code because all code should describe itself. It's just too tempting to have everything perfect.