Reading cool code, and reading code coolly

Kevlin Henney gave an interesting keynote at the GOTO conference in Aarhus this year. It was entitled "Cool code".

He argued that engineers should explicitly spend time reading code. Not reading as a means to find something in the code. Reading as a means to find the art of the code. And he went on to exemplify what he meant by showing pieces of code that were cool in various ways. Some were cool because of historical reasons. Some were cool because they were concise. And some were simply cool. You can see some of them in the slides he used.

The essence of the talk was captured nicely in a quote from Stephen King:

If you don’t have time to read, you don’t have the time or the tools to write.
Stephen King

I very much welcome any argument that raises the awareness for the activity of digesting existing code. There is beauty to be found in software systems, but we have to know how to look for it and how to recognize it when we see it. It is this skill that will make us want to create beauty in our systems.

While reading cool code is important, we should pay equal attention to the very act of consuming the code. Digesting large code bases through analysis can be equally enlightening from at least two points of view: to program an analysis, you have to think about what is it that you are looking for. And you have to be quite specific about it. This exercise exposes the hidden structure of the code, and in turn, it trains your reading skill.

Reading cool code is important. But, we should read it coolly.

Posted by Tudor Girba at 29 November 2011, 11:50 pm link
|

Comments

"[…] there was a person who wrote a CAD system in AWK."

CAD, as in Computer-aided design ?

Posted by Damien Pollet at 30 November 2011, 12:51 am link
|