Managers roll their eyes. Colleagues shake their heads. Nobody wants to hear it, but someone will undoubtedly say it: “their code sucks.” That simple phrase creates an environment for unadulterated ignorance. Perhaps they said it to reinforce their belief that they know everything or to couch their insecurities that they know nothing or perhaps, both. When they say it, the entire team collectively groans. And this little programmer that said it is non-the-wiser.
What possesses a programmer to say such things? Is it youth and inexperience? Ego? A lack of expressive ability?
Bad code is rather easy to recognize. There are the basics in terms of style: obscurely-named variables, inconsistent indenting, over-abundant iterators, and so forth. There are the more tricky things like bad design choices. When bad code is bad, it is obvious. It doesn’t work.
What I find incredible is that a programmer will be handed a working application. The source for said application has been running fine in production. They are tasked with improving it. They read any documentation there is. They scour the source. They poke around and fiddle and do what programmers do. Then the big meeting comes up… and when they are asked how long they think their assigned task will take, it comes out — “their code sucks.”
Somewhere along the line, the programmer gave up. However unwieldy, monstrous, and difficult to understand the source of the application is; it’s not even worth getting into. If the code sucks, it’s better simply to re-write the entire thing, choose a different solution, or what-have-you. The excuses here are limitless and depend largely on the ignorance of the programmer and their colleagues.
Some code isn’t great. Some of it is monstrous, hard to understand, and will be difficult for an inexperienced programmer to cope with. That doesn’t mean it should be canned and hidden somewhere in the basement. The problem isn’t the code — it’s the programmer. With a little perseverance, planning, and a forward-looking view, any spaghetti-monster-of-doom can be tamed.
One must simply realize that they will not know everything; that the universe is a big and unpredictable place; that code they didn’t write and don’t understand, does actually work. It’s one of those zen things. Like meditating and knowing when to use recursion.