Beautiful Code

Posted by Brian Fri, 11 Mar 2011 02:39:25 GMT

Beautiful Code Edited By Andy Oram & Greg Wilson


Beautiful Code is a collection of essays from programmers working in a number of different areas, from language design, to operating systems, to enterprise application development. If you are a programmer, chances are good that at least a couple of essays in here will appeal to you.

First, the good. Some essays are great. Yukihiro Matsumoto, the creator of Ruby, has arguably the best (and shortest) essay in the collection, concentrating on what makes code beautiful and how those factors influenced his design of Ruby. Elliote Rusty Harold’s contribution on lessons learned creating XML verifiers is also a standout. He goes through several implementations, learning from each to improve the performance of the next, all while maintaining correctness across all cases. Charles Petzold’s description of on-the-fly code generation for image processing is dense, but interesting. As a sometimes Python programmer, Andrew Kuchling’s discussion of the design trade-offs in the design of Python’s dictionary implementation was much appreciated and gives insights into performance optimizations you can make with your application if needed.

Unfortunately there is also a fair amount of bad. One issue is that the book is simply too long. The editors mention they got a more enthusiastic response from contributors then they expected. They may have felt compelled to include all or most of the responses. But beyond the length, some of the essays are just bad. For example, Douglas Crockford’s “Top Down Operator Precedence” essay dives right in without actually explaining the algorithm. It is explained piecemeal throughout the code, but you never get a good feel for exactly what is going on. Other contributors have the view that whatever skills they need to do their work is essential to being a true software engineer. For example, Bryan Cantrill writes that postmortem debugging with core dumps “is an essential part of our craft - a skill that every serious software engineer should develop.” Quite honestly, only a very narrow niche of software engineers are serious then. Other authors take similar narrow views at times, whether it is the author of math libraries feeling that everybody needs to care about high performance computing or C programmers feeling that every real programmer should implement their own dynamic dispatch code in C at some point in their careers.

Beautiful Code is worth the read, but don’t hesitate to skim over the essays that don’t interest you. I probably would have enjoyed it more if I didn’t force myself through most of the them. (Also see Jeff Atwood’s review for a good explanation of why the title of the book is misleading.)


    (leave url/email »)

       Comment Markup Help Preview comment