Monday, July 2, 2007

Beautiful Code Leading Programmers Explain How They Think

Beautiful Code

Title: Beautiful Code: Leading Programmers Explain How They Think
First Edition: June 2007
Series: Theory In Practice
ISBN 10: 0-596-51004-7
ISBN 13: 9780596510046
Pages: 618

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. Beautiful Code is an opportunity for master coders to tell their story. All author royalties will be donated to Amnesty International.


Table Of Contents

Foreword
by Greg Wilson

Preface

1. A Regular Expression Matcher
by Brian Kernighan
The Practice of Programming
Implementation
Discussion
Alternatives
Building on It
Conclusion

2. Subversion's Delta Editor: Interface As Ontology
by Karl Fogel
Version Control and Tree Transformation
Expressing Tree Differences
The Delta Editor Interface
But Is It Art?
Abstraction As a Spectator Sport
Conclusions

3. The Most Beautiful Code I Never Wrote
by Jon Bentley
The Most Beautiful Code I Ever Wrote
More and More with Less and Less
Perspective
What Is Writing?
Conclusion
Acknowledgments

4. Finding Things
by Tim Bray
On Time
Problem: Weblog Data
Problem: Who Fetched What, When?
Search in the Large
Conclusion

5. Correct, Beautiful, Fast (in That Order): Lessons from Designing XML Verifiers
by Elliotte Rusty Harold
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

6. Framework for Integrated Test: Beauty Through Fragility
by Michael Feathers
An Acceptance Testing Framework in Three Classes
The Challenge of Framework Design
An Open Framework
How Simple Can an HTML Parser Be?
Conclusion

7. Beautiful Tests
by Alberto Savoia
That Pesky Binary Search
Introducing JUnit
Nailing Binary Search
Conclusion

8. On-the-Fly Code Generation for Image Processing
by Charles Petzold

9. Top Down Operator Precedence
by Douglas Crockford
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

10. The Quest for an Accelerated Population Count
by Henry S. Warren, Jr.
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

11. Secure Communication: The Technology Of Freedom
by Ashish Gulhati
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

12. Growing Beautiful Code in BioPerl
by Lincoln Stein
BioPerl and the Bio::Graphics Module
The Bio::Graphics Design Process
Extending Bio::Graphics
Conclusions and Lessons Learned

13. The Design of the Gene Sorter
by Jim Kent
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

14. How Elegant Code Evolves with Hardware: The Case of Gaussian Elimination
by Jack Dongarra and Piotr Luszczek
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

15. The Long-Term Benefits of Beautiful Design
by Adam Kolawa
My Idea of Beautiful Code
Introducing the CERN Library
Outer Beauty
Inner Beauty
Conclusion

16. The Linux Kernel Driver Model: The Benefits of Working Together
by Greg Kroah-Hartman
Humble Beginnings
Reduced to Even Smaller Bits
Scaling Up to Thousands of Devices
Small Objects Loosely Joined

17. Another Level of Indirection
by Diomidis Spinellis
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?

18. Python's Dictionary Implementation: Being All Things to All People
by Andrew Kuchling
Inside the Dictionary
Special Accommodations
Collisions
Resizing
Iterations and Dynamic Changes
Conclusion
Acknowledgments

19. Multidimensional Iterators in NumPy
by Travis E. Oliphant
Key Challenges in N-Dimensional Array Operations
Memory Models for an N-Dimensional Array
NumPy Iterator Origins
Iterator Design
Iterator Interface
Iterator Use
Conclusion

20. A Highly Reliable Enterprise System for NASA's Mars Rover Mission
by Ronald Mak
The Mission and the Collaborative Information Portal
Mission Needs
System Architecture
Case Study: The Streamer Service
Reliability
Robustness
Conclusion

21. ERP5: Designing for Maximum Adaptability
by Rogerio Atem de Carvalho and Rafael Monnerat
General Goals of ERP
ERP5
The Underlying Zope Platform
ERP5 Project Concepts
Coding the ERP5 Project
Conclusion

22. A Spoonful of Sewage
by Bryan Cantrill

23. Distributed Programming with MapReduce
by Jeffrey Dean and Sanjay Ghemawat
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

24. Beautiful Concurrency
by Simon Peyton Jones
A Simple Example: Bank Accounts
Software Transactional Memory
The Santa Claus Problem
Reflections on Haskell
Conclusion
Acknowledgments

25. Syntactic Abstraction: The syntax-case Expander
by R. Kent Dybvig
Brief Introduction to syntax-case
Expansion Algorithm
Example
Conclusion

26. Labor-Saving Architecture: An Object-Oriented Framework for Networked Software
by William R. Otte and Douglas C. Schmidt
Sample Application: Logging Service
Object-Oriented Design of the Logging Server Framework
Implementing Sequential Logging Servers
Implementing Concurrent Logging Servers
Conclusion

27. Integrating Business Partners the RESTful Way
by Andrew Patzer
Project Background
Exposing Services to External Clients
Routing the Service Using the Factory Pattern
Exchanging Data Using E-Business Protocols
Conclusion

28. Beautiful Debugging
by Andreas Zeller
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

29. Treating Code As an Essay
by Yukihiro Matsumoto

30. When a Button Is All That Connects You to the World
by Arun Mehta
Basic Design Model
Input Interface
Efficiency of the User Interface
Download
Future Directions

31. Emacspeak: The Complete Audio Desktop
by T. V. Raman
Producing Spoken Output
Speech-Enabling Emacs
Painless Access to Online Information
Summary
Acknowledgments

32. Code in Motion
by Laura Wingerd and Christopher Seiwald
On Being "Bookish"
Alike Looking Alike
The Perils of Indentation
Navigating Code
The Tools We Use
DiffMerge's Checkered Past
Conclusion
Acknowledgments
Further Reading

33. Writing Programs for "The Book"
by Brian Hayes
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

Afterword
by Andy Oram

Contributors
index


Sample Chapter: Chapter 4: Finding Things (PDF Format)

Amazon Link: Beautiful Code: Leading Programmers Explain How They Think

No comments: