Words of wisdom... PDF Print E-mail
Written by JLangbridge   
Monday, 30 January 2012 15:19
Brian Kernighan

"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian Kernighan

 

Words of wisdom from one of the best. Very philosophic, very intense.

 

Tim O'Reilly reposted this quote in a Google+ feed. A few comments followed. This quote make sens, but what did he really mean? Does that mean that the average developer cannot debug? Does it mean that you shouldn't try your absolute best? Maybe a mis of the two, with a dash of a few other things here and there. Let's think about it. There are 2 ways of writing code, the easy to read way, and the highly optimized way. I'm an optimization evangelist, but even I don't optimize everything. Coding can be like writing a book, and the story unfolds itself as time goes by. When I starded, I might have wanted to do something specific, but that all changes as I encounter unforeseen details, or when I run into problems. I don't start optimizing everything, and indeed, I never optimize the first time round. I want something I can read easily, or that someone else can read easily. I have no guarantee that I will still be working on a particular project, and that someone will not be in my place, continuing my code. Part of being a software consultant is knowing that I won't be doing absolutely everything. Sooner or later, my code will be in someone else's hands. That person has to be able to debug what I do. In order for him to be able to debug it, my work has to be simple. Yet another quote:

Any fool can write code that a computer can understand.  Good programmers write code that humans can understand.  ~Martin Fowler

When training non-IT people about what developers do, I often play a little game, putting myself in the place of a robot. I will follow their instructions, to the letter, no more, no less. We have had some fun doing simple things like et a glass of water, or pick up a folder and put it on the table. Learning to speak to a computer isn't all that easy, it does take some getting used to. Talking to a computer so that someone else can easily understand takes some time, and effort. As they say on the bottle of shampoo, lather, rinse, repeat. Sooner or later, you run out of shampoo.

All this sums up my favorite quote:

[A]nd then it occurred to me that a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things.  They are, in short, a perfect match.  ~Bill Bryson


Last Updated on Monday, 30 January 2012 15:40
 

Add comment


Security code
Refresh