Ph: 8008898969
[image]
Beautiful Code
Leading Programmers Explain How They Think
By Andy Oram, Greg Wilson
Publisher: O'Reilly Media
Released: June 2007
Pages: 624

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, KarlFogel, 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 PiotrLuszczek, Adam Kolawa, Greg Kroah-Hartman, Diomidis Spinellis, AndrewKuchling, Travis E. Oliphant, Ronald Mak, Rogerio Atem de Carvalho andRafael Monnerat, Bryan Cantrill, Jeff Dean and Sanjay Ghemawat, SimonPeyton Jones, Kent Dybvig, William Otte and Douglas C. Schmidt, AndrewPatzer, 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.

Chapter 1 A Regular Expression Matcher

The Practice of Programming

Implementation

Discussion

Alternatives

Building on It

Conclusion

Chapter 2 Subversion's Delta Editor: Interface As Ontology

Version Control and Tree Transformation

Expressing Tree Differences

The Delta Editor Interface

But Is It Art?

Abstraction As a Spectator Sport

Conclusions

Chapter 3 The Most Beautiful Code I Never Wrote

The Most Beautiful Code I Ever Wrote

More and More with Less and Less

Perspective

What Is Writing?

Conclusion

Acknowledgments

Chapter 4 Finding Things

On Time

Problem: Weblog Data

Problem: Who Fetched What, When?

Search in the Large

Conclusion

Chapter 5 Correct, Beautiful, Fast (in That Order): Lessons from Designing XML Verifiers

The Role of XML Validation

The Problem

Version 1: The Naïve Implementation

Version 2: Imitating the BNF Grammar O(N)

Version 3: First Optimization O(log N)

Version 4: Second Optimization: Don't Check Twice

Version 5: Third Optimization O(1)

Version 6: Fourth Optimization: Caching

The Moral of the Story

Chapter 6 Framework for Integrated Test: Beauty Through Fragility

An Acceptance Testing Framework in Three Classes

The Challenge of Framework Design

An Open Framework

How Simple Can an HTML Parser Be?

Conclusion

Chapter 7 Beautiful Tests

That Pesky Binary Search

Introducing JUnit

Nailing Binary Search

Conclusion

Chapter 8 On-the-Fly Code Generation for Image Processing

Chapter 9 Top Down Operator Precedence

JavaScript

Symbol Table

Tokens

Precedence

Expressions

Infix Operators

Prefix Operators

Assignment Operators

Constants

Scope

Statements

Functions

Array and Object Literals

Things to Do and Think About

Chapter 10 The Quest for an Accelerated Population Count

Basic Methods

Divide and Conquer

Other Methods

Sum and Difference of Population Counts of Two Words

Comparing the Population Counts of Two Words

Counting the 1-Bits in an Array

Applications

Chapter 11 Secure Communication: The Technology Of Freedom

The Heart of the Start

Untangling the Complexity of Secure Messaging

Usability Is the Key

The Foundation

The Test Suite

The Functioning Prototype

Clean Up, Plug In, Rock On…

Hacking in the Himalayas

The Invisible Hand Moves

Speed Does Matter

Communications Privacy for Individual Rights

Hacking the Civilization

Chapter 12 Growing Beautiful Code in BioPerl

BioPerl and the Bio::Graphics Module

The Bio::Graphics Design Process

Extending Bio::Graphics

Conclusions and Lessons Learned

Chapter 13 The Design of the Gene Sorte

The User Interface of the Gene Sorter

Maintaining a Dialog with the User over the Web

A Little Polymorphism Can Go a Long Way

Filtering Down to Just the Relevant Genes

Theory of Beautiful Code in the Large

Conclusion

Chapter 14 How Elegant Code Evolves with Hardware The Case of Gaussian Elimination

The Effects of Computer Architectures on Matrix Algorithms

A Decompositional Approach

A Simple Version

LINPACK's DGEFA Subroutine

LAPACK DGETRF

Recursive LU

ScaLAPACK PDGETRF

Multithreading for Multi-Core Systems

A Word About the Error Analysis and Operation Count

Future Directions for Research

Further Reading

Chapter 15 The Long-Term Benefits of Beautiful Design

My Idea of Beautiful Code

Introducing the CERN Library

Outer Beauty

Inner Beauty

Conclusion

Chapter 16 The Linux Kernel Driver Model: The Benefits of Working Together

Humble Beginnings

Reduced to Even Smaller Bits

Scaling Up to Thousands of Devices

Small Objects Loosely Joined

Chapter 17 Another Level of Indirection

From Code to Pointers

From Function Arguments to Argument Pointers

From Filesystems to Filesystem Layers

From Code to a Domain-Specific Language

Multiplexing and Demultiplexing

Layers Forever?

Chapter 18 Python's Dictionary Implementation: Being All Things to All People

Inside the Dictionary

Special Accommodations

Collisions

Resizing

Iterations and Dynamic Changes

Conclusion

Acknowledgments

Chapter 19 Multidimensional Iterators in NumPy

Key Challenges in N-Dimensional Array Operations

Memory Models for an N-Dimensional Array

NumPy Iterator Origins

Iterator Design

Iterator Interface

Iterator Use

Conclusion

Chapter 20 A Highly Reliable Enterprise System for NASA's Mars Rover Mission

The Mission and the Collaborative Information Portal

Mission Needs

System Architecture

Case Study: The Streamer Service

Reliability

Robustness

Conclusion

Chapter 21 ERP5: Designing for Maximum Adaptability

General Goals of ERP

ERP5

The Underlying Zope Platform

ERP5 Project Concepts

Coding the ERP5 Project

Conclusion

Chapter 22 A Spoonful of Sewage

Chapter 23 Distributed Programming with MapReduce

A Motivating Example

The MapReduce Programming Model

Other MapReduce Examples

A Distributed MapReduce Implementation

Extensions to the Model

Conclusion

Further Reading

Acknowledgments

Appendix: Word Count Solution

Chapter 24 Beautiful Concurrency

A Simple Example: Bank Accounts

Software Transactional Memory

The Santa Claus Problem

Reflections on Haskell

Conclusion

Acknowledgments

Chapter 25 Syntactic Abstraction: The syntax-case Expander

Brief Introduction to syntax-case

Expansion Algorithm

Example

Conclusion

Chapter 26 Labor-Saving Architecture: An Object-Oriented Framework for Networked Software

Sample Application: Logging Service

Object-Oriented Design of the Logging Server Framework

Implementing Sequential Logging Servers

Implementing Concurrent Logging Servers

Conclusion

Chapter 27 Integrating Business Partners the RESTful Way

Project Background

Exposing Services to External Clients

Routing the Service Using the Factory Pattern

Exchanging Data Using E-Business Protocols

Conclusion

Chapter 28 Beautiful Debugging

Debugging a Debugger

A Systematic Process

A Search Problem

Finding the Failure Cause Automatically

Delta Debugging

Minimizing Input

Hunting the Defect

A Prototype Problem

Conclusion

Acknowledgments

Further Reading

Chapter 29 Treating Code As an Essay

Chapter 30 When a Button Is All That Connects You to the World

Basic Design Model

Input Interface

Efficiency of the User Interface

Download

Future Directions

Chapter 31 Emacspeak: The Complete Audio Desktop

Producing Spoken Output

Speech-Enabling Emacs

Painless Access to Online Information

Summary

Acknowledgments

Chapter 32 Code in Motion

On Being "Bookish"

Alike Looking Alike

The Perils of Indentation

Navigating Code

The Tools We Use

DiffMerge's Checkered Past

Conclusion

Acknowledgments

Further Reading

Chapter 33 Writing Programs for "The Book"

The Nonroyal Road

Warning to Parenthophobes

Three in a Row

The Slippery Slope

The Triangle Inequality

Meandering On

"Duh!"—I Mean "Aha!"

Conclusion

Further Reading

Appendix Afterword

Appendix Contributors

Colophon

Title:
Beautiful Code
Edited By:
Andy Oram, Greg Wilson
Publisher:
O'Reilly Media
Formats:
Print Ebook Safari Books Online
Print:
June 2007
Ebook:
December 2008
Pages:
624
Print ISBN:
978-0-596-51004-6
| ISBN 10:
0-596-51004-7
Ebook ISBN:
978-0-596-15843-9
| ISBN 10:
0-596-15843-2
Description
Table of Contents
Product Details
[image]
[image]
Recommended for You
[image]
[image]
Customer Reviews
[image]

REVIEW SNAPSHOT®

by PowerReviews
oreilly Beautiful Code
 
4.1

(based on 11 reviews)

[image]

Ratings Distribution

5 Stars

 

(3)

4 Stars

 

(6)

3 Stars

 

(2)

2 Stars

 

(0)

1 Stars

 

(0)

67%

of respondents would recommend this to a friend.

Pros

Cons

Best Uses

Intermediate (3) Student (3)
Reviewer Profile: Developer (3)

Reviewed by 11 customers

Sort by

Displaying reviews 1-10

Back to top

Previous | Next »

 
4.0

For students and graduates ...

By jkindler

from Bonn, Germany

About Me Developer

Pros

Easy to understand Good overview Well-written

Cons

Not comprehensive enough

Best Uses

Intermediate Novice Student

Comments about oreilly Beautiful Code:

It's nice to have multiple languages covered. I learned some interesting details about languages I don not use regularly.

Some of the examples are debatable - esp. the Pythong database merging example. This one could possibly be much simpler (and faster) using only main query and then shooting off queries to the other two tables to get associated records by ID. ;-)

I think it is a great book for beginners, students, graduates and people who just started working in development. Good code style is often underestimated - and this will give you some good advice.

(3 of 6 customers found this review helpful)

 
3.0

do you like bare bones of coding-go, go

By Michal Owsiak

from Poland

About Me Developer

Verified Reviewer

Pros

Concise

Cons

Difficult to understand

Best Uses

Expert Intermediate Student

Comments about oreilly Beautiful Code:

Andy and Greg collected quite impressive set of IT related essays and enclosed them within Beautiful Code. These are the texts that refer to various topics and treat them in a hard, engineering way. There is no place for humanity science like stuff. There is quite a loot of examples getting to bare bones of the problems.

During my studies I had to go through quite a some IT related books. I don't say I didn't liked them however, Beautiful Code reminds me all these books some way. Each problem described is somehow intriguing and innovative while at the same time you can say - hey, I have read that already somewhere. Don't let me be misunderstood, I value the book, but for me, now it's not the best pick. Hawking wrote once: "Somebody told me, that each equation put into my book will reduce the number of sold copies by two - thus I have put just one into it". Well, Beautiful Code has much, much more than one equation inside.

(6 of 6 customers found this review helpful)

 
4.0

Excellent book for the practicing coder

By Another Working Programmer

from Chatham ON, Canada

About Me Designer, Developer

Verified Reviewer

Pros

Accurate Concise Easy to understand Helpful examples Well-written

Cons

Best Uses

Expert Intermediate Novice Student

Comments about oreilly Beautiful Code:

This isn't the book you get to go and figure out some new technology you want to integrate into your system. The great thing about this book is that it's the book version of the conversation you have with coders you may meet at conference where you trade good stories about challenges you had while in front of your code editor. It brings an element of storytelling to a subject that is usually all explanation and example. Its a breath of fresh air in the technical book genre.

(6 of 6 customers found this review helpful)

 
4.0

A beautiful addition to your bookshelf.

By William Deegan

from Undisclosed

Comments about oreilly 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.

(4 of 4 customers found this review helpful)

 
4.0

Beauty is in the eye of the beholder

By joshSVUG

from Undisclosed

Comments about oreilly Beautiful Code:

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.

(1 of 3 customers found this review helpful)

 
4.0

A Very Good Book

By Amar

from Undisclosed

Comments about oreilly Beautiful Code:

 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.

 
5.0

Excellent. Must read for software engineers.

By jdruin

from Undisclosed

Comments about oreilly Beautiful Code:

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.

(1 of 2 customers found this review helpful)

 
5.0

Learn How to Think

By Max Luebbe

from Undisclosed

Comments about oreilly Beautiful Code:

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.

 
4.0

A classic in the making?

By Mitch Wheat

from Undisclosed

Comments about oreilly Beautiful Code:

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 ]

 
3.0

Beautiful Code

By Regnard Kreisler C. Raquedan

from Undisclosed

Comments about oreilly Beautiful Code:

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.

Displaying reviews 1-10

Back to top

Previous | Next »

 
Buy 2 Get 1 Free Free Shipping Guarantee
Buying Options
Save a Tree - Go Digital  what is this?
Ebook: Was: $35.99
Now: $17.99
Formats: APK, DAISY, ePub, Mobi, PDF
[image]
Print & Ebook: $49.49
[image]
Print: $44.99
[image]
Safari Books Online - Read now >
[image]
 


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser