Perfection Paralysis

I’ve spent more than a decade in professional software development. I’ve seen and fought this demon time and time again. The demon’s name is Perfection Paralysis.

It’s quite the beast. When you have so many eyes reviewing and critiquing your code, you want to be the best you can possibly be. You want your code to be representative of all that you’re capable of, because that’s what you’re judged by.

I think this is why I find writing my own hobby code so relaxing. No code reviews, no tech designs, no architecture reviews, and planning meetings and etc. I simply let the thoughts flow from my mind to my fingers; code happens, the world is changed.

I warn of the dangers of perfection paralysis because there is no single solution to solving a problem, there’s in fact, probably an infinite ways to solve it. No matter which way you go, there is always room for criticism and improvement. You can make it faster, you can make it neater, you can make it more extensible, you can make it more testable, and the list goes on.

I think one factor that a lot of developers don’t take into account, is how much more work they’re subjecting themselves and possibly their organization to.

Your code looks great, but did you do Doc Block commenting? Your code works, but is it type strict? Your tests passes, but does it handle mutation testing well? You have test coverage, but is it 100% test coverage, or partial coverage? Your test passes 100%, but does it pass for all device, or just a single device? Your application works now, but will it work once the load increases by a hundred folds? So on… and so on…

I find myself in this situation ALL the time, both in the professional environment and the non-professional environment. Great, this JS code works, but should I have done it in React? Great, it works in React, but should I have incorporated Flux/Redux? I finished it in native PHP, but should I have used the Laravel Framework? I did it in Laravel, but maybe I should have done this in GoLang? Great, I’ve coded it in GoLang, but maybe I should have coded it with Gorilla? The data persistent layer is in MySQL, but maybe I should have used DynamoDB? The list goes on and on and on, it will NEVER stop, because there’s simply no stop case, this is simply the nature of our work, there will never be a best, because the best is yet to come.

I think remembering the BIG picture helps me maintain my sanity. Reminding myself of the objective allows me to focus on running past the finish line instead of being crippled by anxiety at the starting line. In the end, code is code. It’s simply a series of instructions to a computer, a persistent mechanism, and presentation mechanism. No matter how we’ve changed things, those things stay the same. In the end, no matter how you code it, if it fulfills the objective, it’s working code.

I think a concept that a lot of developers forget in the software development life cycle, is that code becomes obsolete. In this RAPIDLY changing world, should be optimize for 10 years? 5 years? 3? 2? 1? 6 months? That’s a tough question, but let me answer it with another one. If you wrote optimal code using ES 5, is it still optimal under ES 6? If it was optimal ES 6 code, is it still optimal ES 7 code? If you coded it using React, could material UI have done a better job? If you used jQuery, and now you have all these built-in selectors to javascript, is it still the optimal approach?

I urge myself, and other developers to optimize for the situation as it stands, in their own life, in their environment, and future proof it to a reasonable extent. Architect it for the current and PLANNED next steps, but I wouldn’t optimize it any further than that.

Advance the code and project in an interactive, self-rewarding manner, rather than a giant hunk perfection that is either ALL or NOTHING, a long ways into the future from now. When you have 1 or 0, the expected value is 0.5, but if you allow yourself to build everything in an incremental manner, it’ll be much less stressful, and you’ll have more fun.

So for myself, or anyone else reading this… “It’s okay, it’ll be fine, even if there might be a better way, just do it the best way for the current circumstances, when the circumstances change, much like the Monty Hall paradox, we can pivot then”.

Leave a comment

Your email address will not be published. Required fields are marked *