Beautiful Code
Beautiful Code: Leading Programmers Explain How They Think
Edited by Andy Oram & Greg Wilson
Ever wonder how some of the most notable programmers think and approach programming problems?
When was the last time you opened an analysis of algorithms book, or
delved into the beauty of quicksort and recursive binary partitioning
solutions?
Not for the faint of heart, it will make your brain hurt, but in a
good way. Does this sound like a commercial? Well, that's how good
this book is.
If you brave reading this book, you'll get to hear what notable
programmers such as Brian Kernighan, Lincoln Stein, Charles Petzold
(o.k. those are just the names I recognized before I started reading
the book) consider "beautiful" code, and how they approach creating
and/or analyzing it. Same goes for pieces of projects such as subversion, perforce, python, jUnit.
Charles Petzold goes through an excruciating to read, but interesting,
example of on the fly byte code generated for .NET. The net is a 4x
speed up over plain code, though I would argue whether this qualifies
for "Beautiful", maybe a neat "hack", but probably not Beautiful.
Elliotte Rusty Harold goes through a description of how he
contributed/created JDOM and later XOM, what he learned from the first
effort, and how he optimized XOM to its current state, using analysis
of the algorithms, clever programing, use of precalculated values, and
some other good tricks to come up with a high speed validating XML
parser.
Want to understand the subversion delta editor? Read chapter two, again, not for the light read.
So if you want to learn about your art, you know programming, brew
yourself a fresh pot or two of coffee, sit down and read. This book is
probably best read a chapter at a time to absorb the content. I know I had to reread some of the
examples to get the little light bulb above my head to glow brightly,
but I will say it's worth the effort.
I can count on one hand the number of programming or programming
related books I would recommend every programmer reads, this gets added
to that short, and changing, list.