Beautiful Code: Leading Programmers Explain How They Think (Theory in Practice (O'Reilly)) Summary and Reviews

Beautiful Code: Leading Programmers Explain How They Think (Theory in Practice (O'Reilly))

Beautiful Code: Leading Programmers Explain How They Think (Theory in Practice (O'Reilly))
List Price: $44.99
Our Price: $32.00
You Save: $12.99 (29%)
Availability: Usually ships in 1-2 business days
Buy Used: from $15.99 (click here)
Category: Book
See more book details and other editions


or

Book Summary Information

Editor: Andy Oram
Editor: Greg Wilson
Edition: Paperback
Audio: English (Original Language); English (Unknown); English (Published)
Format: Illustrated
Published: 2007-06-26
ISBN: 0596510047
Number of pages: 618
Publisher: O'Reilly Media, Inc.

Book Reviews of Beautiful Code: Leading Programmers Explain How They Think (Theory in Practice (O'Reilly))

Book Review: It ain't all that beautiful...
Summary: 2 Stars

The editors of this uneven book give us 33 chapters from various, often well-known developers, in which these developers describe some code and explain why they think that it is beautiful. There are some gems, but it's not light reading and quite a bit of it is a real slog. If you are a professional programmer, it's probably worth the effort, but otherwise I'd steer clear.

And, in fact, all too much of the code is downright ugly. This starts, sadly enough, with the first example, by Brian Kernighan, describing a limited-capacity regular expression matcher.

Yes, THAT Brian Kernighan, a software god among men. But the example he describes as beautiful would be the last thing I would ever want in any software that I had to maintain. I am sure it is efficient, and it probably works, but the only beauty that I can see is that, if you convince yourself you understand why it works, you've also proven to yourself that your mental abilities put you in an elite category of coder. God help you if you need to modify the method's functionality or (shudder) debug it.

Another dubious entry in the book is by Adam Kolawa, who describes the CERN mathematical library. He claims that no library routine can be beautiful if it uses dynamic memory allocation. The software architecture he deems beautiful passes working memory, in the form of an array to the library routines, which in turn pass it on to their subroutines. In fact, the space used by the input parameters is reused to hold the solution. I am sure that CERN math library is an excellent package, but I would hate to have the job of tracking down bugs in a system in which all the subroutines in the stack were writing back into the same array.

Software ugliness can take many forms, as, for example, in the chapter by Ronald Mak, describing NASA software used for the Mars Rover mission. The solution for a highly reliable, long running, independent system? SOA, using Java 2 and J2EE EJBs. I am a big fan of Java and J2EE, but why on earth (or Mars!) would the Mars Rover system need EJBs? The SOA and EJB technology is at its best when coupling diverse databases and interacting with legacy systems. It brings with it a significant complexity and overhead. Why would anyone think this was appropriate for the Mars Rover?

For my taste, the worst of the worst was an article by R. Kent Dybvig, describing a program for analyzing code and detecting parameter name clashes. The code to be analyzed is in Scheme, a Lisp dialect. It's been awhile since I've fooled with LISP, but I was ready to give it a try. So here is an example of a macro that has potential scope issues, if there is a bound variable t elsewhere in the code:

(or e1 e2) -> (let ([t e1]) (if t t e2))

...and here is the refactored code, in which the problem is fixed:

(or e1 e2) -> (let [g e1] (if g g e2))

I stared dumbly at this for all too long a time until I read the next phrase, "in which 'g' is a generated (fresh) identifier". Here I'd fault the author for a really rotten presentation, and also for begging the question, since the whole problem he is purporting to solve is avoiding name clashes.

In fairness, the book also has many descriptions of genuinely beautiful code. I especially enjoyed the article by Charles Petzold on efficient image processing through code generated on-the-fly. Also, Henry Warren essay on devising efficient algorithms for counting the number of enabled bits in a bit string is fascinating. Yet another stimulating article is by Brian Hayes, who describes an efficient approach for determining if three points are co-linear. This article also uses LISP as the example language, but unlike Dybvig's piece, it's clear, and "porting" the approach to Java or C++ would be straight-forward.

In summary, "Beautiful Code" is a very mixed bag. On balance, it is probably worth reading, but without doubt it is a disappointment.

Computers & Internet Books

Book Subjects
Most talked about in What a programmer SHOULD read but NEVER have TIME to
Art of Computer Programming, The, Volumes 1-3 Boxed Set (2nd Edition) (The Art of Computer Programming Series) ImageArt of Computer Programming, The, Volumes 1-3 Boxed Set (2nd Edition) (The Art of Computer Programming Series)
by Donald E. Knuth
Addison-Wesley Professional; Published: 1998-10-15; Hardcover; Book
Best price: $104.95
Price in other shops: $189.99
Feynman Lectures on Computation ImageFeynman Lectures on Computation
by Richard P. Feynman, Anthony Hey, Tony Hey, Robin W. Allen
Westview Press; Published: 2000-07; Paperback; Book
Best price: $39.06
Price in other shops: $44.00
The Algorithm Design Manual ImageThe Algorithm Design Manual
by Steve S. Skiena
Springer; Published: 1998-07-31; Hardcover; Book
Best price: $74.74
Price in other shops: $89.95
Distributed Systems: An Algorithmic Approach (Computer and Information Sciences) ImageDistributed Systems: An Algorithmic Approach (Computer and Information Sciences)
by Sukumar Ghosh
Chapman & Hall/CRC; Published: 2006-11-22; Hardcover; Book
Best price: $70.51
Price in other shops: $89.95
Programming Pearls (2nd Edition) (ACM Press) ImageProgramming Pearls (2nd Edition) (ACM Press)
by Jon Bentley
Addison-Wesley Professional; Published: 1999-10-07; Paperback; Book
Best price: $27.66
Price in other shops: $39.99
Peopleware: Productive Projects and Teams   (Second Edition) ImagePeopleware: Productive Projects and Teams (Second Edition)
by Tom DeMarco, Timothy Lister
Dorset House Publishing Company, Incorporated; Published: 1999-02-01; Paperback; Book
Best price: $31.13
Price in other shops: $33.95
The Mythical Man-Month: Essays on Software Engineering, Anniversary Edition (2nd Edition) ImageThe Mythical Man-Month: Essays on Software Engineering, Anniversary Edition (2nd Edition)
by Frederick P. Brooks
Addison-Wesley Professional; Published: 1995-08-12; Paperback; Book
Best price: $24.38
Price in other shops: $39.99
Beautiful Code: Leading Programmers Explain How They Think (Theory in Practice (O'Reilly)) ImageBeautiful Code: Leading Programmers Explain How They Think (Theory in Practice (O'Reilly))
O'Reilly Media, Inc.; Published: 2007-06-26; Paperback; Book
Best price: $32.93
Price in other shops: $44.99
Joel on Software: And on Diverse and Occasionally Related Matters That Will Prove of Interest to Software Developers, Designers, and Managers, and to Those Who, Whether by Good Fortune or Ill Luck, Work with Them in Some Capacity ImageJoel on Software: And on Diverse and Occasionally Related Matters That Will Prove of Interest to Software Developers, Designers, and Managers, and to Those Who, Whether by Good Fortune or Ill Luck, Work with Them in Some Capacity
by Joel Spolsky
Apress; Published: 2004-08-02; Paperback; Book
Best price: $9.45
Price in other shops: $24.99
AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis ImageAntiPatterns: Refactoring Software, Architectures, and Projects in Crisis
by William J. Brown, Raphael C. Malveau, Thomas J. Mowbray
Wiley; Published: 1998-03-20; Paperback; Book
Best price: $16.50
Price in other shops: $49.99
Similar books summaries and other product reviews
High Performance Web Sites: Essential Knowledge for Front-End Engineers ImageHigh Performance Web Sites: Essential Knowledge for Front-End Engineers
by Steve Souders
O'Reilly Media, Inc.; Published: 2007-09-11; Paperback; Book
Best price: $13.26
Price in other shops: $29.99
Founders at Work: Stories of Startups' Early Days ImageFounders at Work: Stories of Startups' Early Days
by Jessica Livingston
Apress; Published: 2007-01-22; Hardcover; Book
Best price: $10.82
Price in other shops: $25.99
The Myths of Innovation ImageThe Myths of Innovation
by Scott Berkun
O'Reilly Media, Inc.; Published: 2007-05-15; Hardcover; Book
Best price: $13.81
Price in other shops: $24.99
Smart and Gets Things Done: Joel Spolsky's Concise Guide to Finding the Best Technical Talent ImageSmart and Gets Things Done: Joel Spolsky's Concise Guide to Finding the Best Technical Talent
by Joel Spolsky
Apress; Published: 2007-05-31; Hardcover; Book
Best price: $3.73
Price in other shops: $16.99
Code Complete: A Practical Handbook of Software Construction ImageCode Complete: A Practical Handbook of Software Construction
by Steve McConnell
Microsoft Press; Published: 2004-07-07; Paperback; Book
Best price: $26.73
Price in other shops: $49.99
Managing Humans: Biting and Humorous Tales of a Software Engineering Manager ImageManaging Humans: Biting and Humorous Tales of a Software Engineering Manager
by Michael Lopp
Apress; Published: 2007-06-12; Paperback; Book
Best price: $7.97
Price in other shops: $24.99
Programming Erlang: Software for a Concurrent World ImageProgramming Erlang: Software for a Concurrent World
by Joe Armstrong
Pragmatic Bookshelf; Published: 2007-07-11; Paperback; Book
Best price: $21.18
Price in other shops: $36.95
Dreaming in Code: Two Dozen Programmers, Three Years, 4,732 Bugs, and One Quest for Transcendent Software ImageDreaming in Code: Two Dozen Programmers, Three Years, 4,732 Bugs, and One Quest for Transcendent Software
by Scott Rosenberg
Three Rivers Press; Published: 2008-02-26; Paperback; Book
Best price: $8.05
Price in other shops: $13.95
RESTful Web Services ImageRESTful Web Services
by Leonard Richardson, Sam Ruby
O'Reilly Media, Inc.; Published: 2007-05-08; Paperback; Book
Best price: $22.36
Price in other shops: $39.99
Programming Collective Intelligence: Building Smart Web 2.0 Applications ImageProgramming Collective Intelligence: Building Smart Web 2.0 Applications
by Toby Segaran
O'Reilly Media, Inc.; Published: 2007-08-16; Paperback; Book
Best price: $21.89
Price in other shops: $39.99