I just finished reading "Beautiful Code", touted as a book in which "leading computer scientists offer case studies that reveal how they found unusual, carefully designed solutions to high-profile projects". Sounds great, right ? [If you're into that sort of thing]
Unfortunately, I don't think the book quite lives up to its billing. The 33 chapters, each contributed by a different set of authors, vary quite widely in quality, ranging from truly beautiful/elegant/intricate analyses to very pedestrian "... and so, children, that's how I was able to make my C code talk to the old mainframe"-type descriptions. Along the way, there's also some plain bad advice ["XML is just text, so you should construct XML documents by using printf statements", basically] and one chapter spirals off into the deep end of Lisp expression evaluation la-la land.
That said, there are a few bits that are definitely worth reading:
- Jon Bentley's chapter is a nice little meditation on statistical analysis versus explicit computational modeling of an algorithm [using everybody's favorite algorithm, Quicksort]
- Bryan Cantrill has a great description of some of the intricacies of implementing concurrency primitives in an OS
- The chapter contributed by Brian Kernighan serves as a useful example of how to actually implement a small regular-expression matcher
... and I'm pretty sure the chapter on how to use Software Transactional Memory to deal with concurrency issues would be mind-expanding if I ever managed to read it without getting lost about 3 pages into it. Maybe I'll just keep chipping away at it.
[Update: here's an entertaining thread on using Erlang to perform the task described in the "Finding Things" chapter of the book. I've been toying with reading up on Erlang myself, so this is a timely find.]