Thursday, September 07, 2017

Must There Always Be Inferior Code?

Some people claim that when you learn high software standards you will never again develop in inferior ways. Is this true?

I think you can arrive at a meaningful answer by using an analogy:

Some people claim that when you learn high medical standards, a doctor or nurse will never again treat a patient in inferior ways. Is that true?

Seen in this light, the answer is obvious. Most doctors and nurses will not treat patients in inferior ways—unless it's an emergency, like an explosion or a fire in which many people need saving in a hurry. If that happens, the doctor or nurse will return to those patients when the emergency has calmed down. Same in software.

But there do exist a few medical professionals who don’t live up to such high standards. They are, after all, human beings. Yet in spite of their inferior practices, some of their patients do get better. Why? Because humans have built-in healing mechanisms—but software does not.

Software with sick code doesn’t heal itself. Those programmers who develop in inferior ways will eventually produce troublesome code. But the key word is "eventually."

The inferior programmer may not be around any longer when the code's trouble makes itself known, so some inferior programmers can get away with hacky ways for an entire career.

It’s a good manager's job to recognize these inferior programmers and replace them and their code before the true costs of their inferior work become evident.

Some managers overuse the tactic of forcing programmers to code in a hurry, as if there's always an emergency. Just as in medicine, emergency treatment of code tends to produce inferior results. Managers who care only about the short-term will not do anything about their inferior programmers, but they, too, may move out before the consequences of their inferior management become apparent.


That’s why inferior programming practices persist. And, as long as programmers and managers are human, inferior practices will always persist. But they don't have to persist in your world. It's up to you. \

Code in haste, debug forever.

1 comment:

Anonymous said...

I'm interested in your initial statement in this post: "Some people claim that when you learn high software standards you will never again develop in inferior ways".

Are you familiar with the Sapir-Whorf Hypothesis? (Which is not a hypothesis, and which neither Sapir or Whorf ever worked on together, but never mind.) It's the idea that spoken language determines mindset, and that by learning another spoken language, you will, as a side-effect, acquire the way of thinking of a native speaker of that tongue.

(The most recent popular expression of this idea was the film 'Arrival', itself based on a short story by Ted Chiang.)

So to me, this statement seems to suggest that Sapir-Whorf applies in some way to coding languages as well as spoken ones, that elegant or well-structured software will make developers code in elegant and well-structured ways. And your post concerns itself with situations where that is over-ridden by managers imposing slapdash technique for short-term gain. Or am I reading too much into the word 'language'?