Notes on “Beautiful Code”

May 28, 2009

While away at ICSE I finished up Beautiful Code.

If one thing is clear, it’s that there’s no agreement among the book’s many authors what “beauty” means when applied to code. Each uses it to name the other software qualities (s)he feels are most important.

Many of the chapters used toy examples not from production. I think real production code rarely reaches the high standards of elegance we dream about.

My personal favourites:

  • Chapter 1, Kernighan: Rob Pike’s basic regular expression matcher.
  • Chapter 8, Petzold: On-the-fly code generation for the .NET virtual machine for image processing.
  • Chapter 9, Crockford: Top-down operator precedence parsing. I continue to be interested in this chapter and Vaughan Pratt’s paper that inspired it.
  • Chapter 10, Warren: Really fast bitcount.
  • Chapter 22, Cantrill: A fascinating debugging tale of Solaris’ threading code.
  • Chapter 23, Dean & Ghemawhat: MapReduce.
  • Chapter 24, Jones: Software transactional memory in Haskell.
Advertisements
%d bloggers like this: