Beautiful Code
Leading Programmers Explain How They Think
By Andy Oram, Greg Wilson
Edited by Andy Oram, Greg Wilson
June 2007
Pages: 618
Series: Theory In Practice
ISBN 10: 0-596-51004-7 |
ISBN 13: 9780596510046




(4) (Average of 8 Customer Reviews)


Description
How do the experts solve difficult problems in software development? In this unique and insightful book, leading computer scientists offer case studies that reveal how they found unusual, carefully designed solutions to high-profile projects. You will be able to look over the shoulder of major coding and design experts as they work through their project's architecture, the tradeoffs made in its construction, and when it was important to break rules.
Full Description
How do the experts solve difficult problems in software development? In this unique and insightful book, leading computer scientists offer case studies that reveal how they found unusual, carefully designed solutions to high-profile projects. You will be able to look over the shoulder of major coding and design experts to see problems through their eyes.
This is not simply another design patterns book, or another software engineering treatise on the right and wrong way to do things. The authors think aloud as they work through their project's architecture, the tradeoffs made in its construction, and when it was important to break rules.
This book contains 33 chapters contributed by Brian Kernighan, Karl
Fogel, Jon Bentley, Tim Bray, Elliotte Rusty Harold, Michael Feathers,
Alberto Savoia, Charles Petzold, Douglas Crockford, Henry S. Warren,
Jr., Ashish Gulhati, Lincoln Stein, Jim Kent, Jack Dongarra and Piotr
Luszczek, Adam Kolawa, Greg Kroah-Hartman, Diomidis Spinellis, Andrew
Kuchling, Travis E. Oliphant, Ronald Mak, Rogerio Atem de Carvalho and
Rafael Monnerat, Bryan Cantrill, Jeff Dean and Sanjay Ghemawat, Simon
Peyton Jones, Kent Dybvig, William Otte and Douglas C. Schmidt, Andrew
Patzer, Andreas Zeller, Yukihiro Matsumoto, Arun Mehta, TV Raman,
Laura Wingerd and Christopher Seiwald, and Brian Hayes.
Beautiful Code is an opportunity for master coders to tell their story. All author royalties will be donated to Amnesty International.
Featured customer reviews

A beautiful addition to your bookshelf.,
April 07 2008
Submitted by
William Deegan
[
Respond |
View]
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.
Beauty is in the eye of the beholder,
January 09 2008
Submitted by
joshSVUG
[
Respond |
View]
I found the book’s concept intriguing. The ability to learn from 33 highly respected members of the programming community is invaluable. I’ve enjoyed my daily dose of Beautify Code… but one thing caught me by surprise:
Not all samples are beautiful… well in my eyes not all samples/chapters are beautiful.
I’ll skip listing the ones I found beautiful, interesting, insightful and educational because I’m sure you will find others that “do it” for you.
All in all I think it’s worth giving this book a shot.
A Very Good Book,
October 03 2007
Submitted by
Amar
[
Respond |
View]
The editing of the book, and the selection of the authors, whose articles are published are good. The articles are extremely useful for design and coding.
The vision of the book has achieved more than my expectations.
The interface designing addressed in the Delta editor interface chapter is very useful for the people who want to understand the system first and then to start coding.
For intermediate programmers, the book helps you to design a solution for a problem in an optimum way.
The topics are more about designing than coding. But the Test driven Development and writing the beautiful tests explained by Alberto Savioa are very useful for the developers who are in Test Driven Development and for the developers who want improve writing tests and who want to start practicing writing tests extensively. Coding principles explained in Code in Motion chapter are very beautiful and the discussion about Code Comprehension is something to follow for better readability of the code.
This book helps to design and code for the given task or in developing a framework or solving a problem.
The book covers all the topics or components of a software system, which can be designed, coded, tested, and debugged beautifully.
I hope that publishers take enough interest to publish some more of this kind.
The endless journey of making software systems more elegant and robust with high performance continues.
Read all reviews
Excellent. Must read for software engineers.,
October 03 2007
Submitted by
jdruin
[
Respond |
View]
This book is a great compilation of software design problems and solutions. Each chapter is an essay from one author which covers a particular problem in computer science and/or software engineering.
The chapters are complete discussions within themselves and they offer different insights into how to solve problems. The solutions are geared to issues found in both the natural world and the business world.
Of particular interest (for me) were the chapters on seraching and debugging.
One aspect of the book that will be either a plus or a minus depending on the reader is that because each chapter is by a different author, there are many distinct writting styles used. Since I was looking towards the book to gain insight into how others solve these problems, I found this useful. Since some of the context of the thought process came through in the writting, it was more like talking to the authors rather than just reading a textbook.
The chapter vary considerably in both topic and the thought process that went into the solution so inevitably there will be chapters that interest any programmer.
The books chapters can be read in any order and the editor indexes the chapters well. Information is easy to find.
Programming Pearls is of similar composition but with shorter chapters and explanations. This book goes a step further and is the next evolution of the computer science short-story tome.
Learn How to Think,
September 17 2007
Submitted by
Max Luebbe
[
Respond |
View]
A frequent topic of discussion among those in any technical field is for a short list of essential books that anyone worth their salt has read. With regards to software engineering, two classics quickly come to mind: Code Complete, and Design Patterns, as well as a recent publication joining the ranks of these epics, Beautiful Code by O'Reilly Press.
What makes Beautiful Code stand apart from the rest, is that it's format is so unconventional when compared to most other programming texts. The book is comprised of 33 Chapters, each written by a different author about a particular bit of code they had written and thought to be particularly eloquent. The best way to explain why this book is so wonderful is to make an analogy about the differences between learning something via a lecture as opposed to a private lesson. Most instructional books will take the lecture approach, where the author shows you one correct way to solve a problem, or complete a certain task and the reader must then digest that as best as possible. Beautiful Code is more like a private lesson in which the author of each chapter is giving the reader personalized attention by explaining their thought processes, how they arrived at each step, and occasionally showing some dead ends that didn't work out. Now consider that these private lessons are being given by such legendary names as Brian Kernighan, Charles Petzold, and Yukihiro Matsumoto - and it becomes obvious why this is a must-have addition to any serious software engineer's bookshelf. Some particularly memorable sections include Karl Fogel's discussion on the origins and implementation of the Subversion Delta Editor and the look inside Google's MapReduce technology by Jeffrey Dean and Sanjay Ghemawat.
As stated earlier, one of the best strengths of this book is that it is language neutral. In each chapter, as the author is speaking from experience on a particular project, rather than writing a chapter for a hypothetical “Better Programming in Language XYZ”, you will see code snippets in C#, MSIL, Python, Ruby, and several other languages (There's even one chapter with Emacs Lisp!). This is important because the insight gained from this book will not be diluted from one language falling out of favor or into obsolescence, and allows for the possibility of this title being just as valuable ten years from now.
Many books will teach you how to solve a problem, but rare are those to teach you how to think. Beautiful Code is one of those select few, and will keep you coming back from project to project to consult its veteran sages of computer science. A worthy edition to any serious programmer's library, and hopefully a second volume is not far off.
A classic in the making?,
August 12 2007
Submitted by
Mitch Wheat
[
Respond |
View]
Is this book a classic in the making? Probably!
This book contains many diverse and wonderful chapters; the highlights for me personally were from Jon Bentley (the ‘Programming Pearls’ author) on “less is more”, Simon Peyton Jones on Concurrency and although it was hard to pick a favourite, I think “Beautiful Debugging” from Andreas Zeller and “Distributed Programming with MapReduce” from Jeffrey Dean and Sanjay Ghemawat stand out.
This is not an easy book, in the sense that it requires that you get into the right frame of mind to fully appreciate some of the subtleties. You might need to find a quiet corner and get into the zone whilst tackling one or two of the more difficult topics. You might even need to read the odd chapter twice before the ‘Aha!’ moment strikes, but it’s certainly worth it. The time spent might well pay for itself several times over if it provides the insight required to solve a problem you encounter.
I believe it is worth buying this book solely for the chapter titled “Distributed Programming with MapReduce” which lucidly describes how large-scale computations can be performed in parallel with the important MapReduce algorithm (which is what Google uses in many applications including google search, across approximately 500,000 machines!). I mentioned the original paper by Jeffrey Dean and Sanjay Ghemawat in a blog post here.
It covers many fields all with the theme of ‘Beautiful Code’. Jon Bentley (the author of Programming Pearls) talks about the ‘most beautiful code he never wrote’! This chapter struck a chord because I often ‘soapbox’ that code should be short as possible but not obtuse. Let’s face it, verbose code is just as hard to understand (if not worse) than terse code.
If you are a programmer purely because it is the way you pay your bills, I don’t think you will find much to help with your day-to-day routine in this book. On the other hand, if you are a programmer who likes to find out how things really work, and gain some insight into the minds of past master craftsman, then you should definitely buy this book.
This book deserves a place on every serious programmers bookshelf since the lessons to be learned will not become obsolete as languages and technologies change. Highly recommended.
There is a web site dedicated to the book here: http://beautifulcode.oreillynet.com/
[ This review originally appeared on my blog: http://mitch-wheat.blogspot.com ]
Beautiful Code,
August 08 2007
Submitted by
Regnard Kreisler C. Raquedan
[
Respond |
View]
The talent of the contributors is undeniable and the text reminds me of the Algorithms class I took in college. The book relates how various software design architects and experts attack and solve problems while maintaining the elegance of the implementation. The range of topics include Perl, Haskell, Python and Ruby. This should give the enthusiastic developer a fresh and broad perspective on software. I have to mention that the book is developer oriented, so expect a lot of code and text intertwined.
Beautiful Code,
July 21 2007
Submitted by Anonymous Reader [
Respond |
View]
I am always looking to for new ways to look at programming problems. I love studying new programming languages in order to bend my mind in new, uncomfortable ways. Both of these are reasons I enjoyed Beautiful Code.
Beautiful Code is a collection of essays from some well known software engineers. That said, I didn't immediately recognize many of their names (this is probably an indication of my lack of exposure in their fields of expertise). If you are like me, there is an alphabetical list of short biographical entries in the back of the book you can use to acquaint yourself with who wrote each chapter.
There are chapters from people in the Perl, Python, Ruby, Google, Scheme, and Haskell communities (among others).
I especially enjoyed reading about Google's MapReduce algorithm, Haskell's Software Transactional Memory, and Scheme's syntax-case macro system. These are subjects I have previously tried to tackle, but the explanations written in this book have helped me approach understanding far better than the academic papers on these subjects I have tried to read.
You'll have to put forth effort to follow the explanations in the chapters as the authors walk you through how they tackle a given problem. This leads eventually to the solution, but may involve many twists and turns along the way. These twists and turns show how the authors think and grants us as the readers insight into how they approach the problems at hand. It's the journey to the desination that sometimes matters more than the destination.
For example, I've long wondered abut the difference between hygenic and non-hygenic macros. Various descriptions on the web have given me some clue, but chapter 25 shows examples and explains the problem very clearly. It then goes about discussing various solutions that have been devised over the years before going into the details of the current solution that is in use today. I've seen the end result before, but knowing what motivated the solution gives me a much greater appreciation for and understanding of it.
The effort required for some chapters may be over your head as they are for me, but those are the chapters where I find the rewards to be the greatest as they force me to look at things in new ways. Once I do achieve understanding I'm able to apply the new found ways of thinking about problems to the situations I face at work and elsewhere which has led to unique and compelling solutions that I would not have thought of before.
I've long been on the search for beauty in the code I write. I have found that as I read and take the time to understand what others see as beautiful, even when I do not see beauty in it at first, I gain greater insights into my craft. I am glad that O'Reilly has taken the time to solicit responses from the authors in this book as it has given us a wealth of experience and expertise that we all can benefit from as we seek to gain greater insights into the various facets of beauty and elegance in code.
Media reviews
"My appreciation of
Beautiful Code is like the one I have for the Justice League or the X-Men a band of exceptional individuals moving towards a common, altruistic end...This should give the enthusiastic developer a fresh and broad perspective on software. I have to mention that the book is developer oriented, so expect a lot of code and text intertwined. They say beauty is in the eye of the beholder. The book hopefully will be able to give you a new way to look at software."
-- Regnard Kreisler C. Raquedan,
Standard Web Standards
"
Beautiful Code presents wide-ranging contributions from 38 pioneering software designers who aim to "rouse and inspire a new generation of coders" by sharing their most closely held secrets. For example, contributor Ronald Mak expounds on his elegant approach to NASA's Mars Rover, and Arun Mehta focuses on the importance of making technology useful to the disabled. Editors Oram and Wilson call the essays from such gifted inventors "inspiring and uplifting.""
-- James Gray, Linux Journal
"This is not an easy book, in the sense that it requires that you get into the right frame of mind to fully appreciate some of the subtleties. You might need to find a quiet corner and get into the zone whilst tackling one or two of the more difficult topics. You might even need to read the odd chapter twice before the 'Aha!' moment strikes, but it's certainly worth it. The time spent might well pay for itself several times over if it provides the insight required to solve a problem you encounter...If you are a programmer who likes to find out how things really work, and gain some insight into the minds of past master craftsman, then you should definitely buy this book. This book deserves a place on every serious programmers bookshelf since the lessons to be learned will not become obsolete as languages and technologies change. Highly recommended."
-- Mitch Wheat,
Treat the Cause, Not the Symptoms!
Read all reviews