Strive to do the best workmanship you can. While the user doesn’t care what the code looks like or how it’s structured, you should. While it’s tempting to, in the interests of expediency to just get something working, there’s serious problems with that attitude. A temporary hack rarely turns out to be that; something that you though would only be needed once will often end up being used repeatedly. And you, or somebody else will have to maintain it. For this reason, you should avoid software entropy. If something needs to be done quickly, then make it work, then make it right. Don’t put off this last step. For all our good intentions, we’re only human, and just like other things that are good for us like eating right and exercising, that which we put off is never done. Get it working, and then make sure that it works right.
Again, this doesn’t come out of any high-faluting sense of aesthetics. This is about proper pride in one’s work and the desire not to create substandard product. This is about making problems, where and when they occur, obvious. This is about maintaining quality.
If you want a practical example, consider your kitchen or better yet, a restaurant kitchen. Chefs have the idea of ‘Mise en Place’, meaning ‘everything in its place’. Part of that is that you clean as you go. Imagine a kitchen where none of the staff cleaned up their workareas continuously as they went about their work: detritus would pile up, dirty utensils would pile up, work would get more and more difficult. It would be tempting for an inexperienced chef to say to themselves, ‘well, I just need to get this done, and I can clean up some other time’. Only, that never happens because there’s always something that just needs to be done now, and their work will get harder and harder because there’s more mess getting in their way, which makes them even less inclined to clean up because more and more work keeps piling up. If they’d cleaned as they went along, however, spreading the effort of maintaining their workarea out and minimising the aggregate effort required, they can keep going at a constant pace and don’t end up worrying about their ever-mounting workload. Oh, and their customers won’t end up getting food poisoning.
The same thing applies to writing software. While it’s important to get things done, it’s equally important to keep things clean. Nobody wants to maintain a big ball of mud, Remember, the path to Oblivion is a long series of tiny, innocent steps.
[Originally published on April 4th, 2008]