Technology:
Cheap Code
If you're a programmer, you want to write code that you can afford to maintain.
21-Mar-2026
Brian Kernighan, one of the principal developers of the Unix operating system and co-creator of the C programming language, is famous for saying, "Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?"1
It's tempting, as a programmer, to make use of the latest or more obscure features of the language you're coding in or framework you're using. To be honest, it's not always because you need that extra bit of efficiency that the feature brings, but rather because you want to show off your skills. And why not? You've put in the effort to become good at what you do. You've paid your dues. You want to earn some respect among your peers.
But as Mr. Kernighan points out, clever code may not be the best option. Clever code can break just as easily as plain old boring code, so you, or a team member, will inevitably be faced with fixing it. And usually by the time this happens, you will have forgotten enough of the details that it will take additional effort to re-learn what your thought process was, understand what the fix was, and come up with a better solution.
So what did that cleverness really accomplish? It increased the cost of your code.
When you're creating software, keep in mind that the time you spend designing and coding works out to be only a small fraction of the total cost of application development. By far the most expensive part of an application in its life cycle is maintenance. So when you're writing software, keep this in mind and let it influence design, coding, and deployment. Write plain, boring code. Write cheap code.
- 1
- Kernighan, Brian W., Plauger, P. J. (1978). The Elements of Programming Style. McGraw-Hill. 978-0070342071.