JANUARY/FEBRUARY 2005 (Vol. 25, No. 1) pp. 98-99
0272-1732/05/$31.00 © 2005 IEEE
Published by the IEEE Computer Society
Published by the IEEE Computer Society
Too much information
|Patterns and code|
PDFs Require Adobe Acrobat
Sometimes the stack of interesting books gets too tall. I can only review a few each time, but there are many more that are too good to pass over. This time I look briefly at a number of books I wish I could spend more time with.
Patterns and code
The idea of a pattern language arose in the context of architecture. In their 1977 book, A Pattern Language: Towns, Buildings, Construction, Christopher Alexander and others try to abstract and name the architectural approaches that lead to satisfying spaces.
Computer scientists took up Alexander's ideas. In October 1994, Addison-Wesley published Design Patterns — Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (these authors are now commonly referred to as the "Gang of Four"). This book gave programmers a new vocabulary and a new way to look at the structure of their programs.
Over the 10 years since Design Patterns appeared, the book's influence has grown. Design patterns have become a part of the computer science curriculum. Yet many programmers are unsure of how to apply well-known design patterns in practical situations. The gang of four did not write an easy book, and more accessible books are just beginning to appear.
Head First Design Patterns, Eric Freeman and Elisabeth Freeman (O'Reilly, 2004, 676 pp., ISBN 0-596-00712-4, $44.95, www.oreilly.com)
Eric Freeman and Elisabeth Freeman are computer scientists who led digital media and Internet efforts at the Walt Disney Company. They have produced a series of Head First books ( www.wickedlysmart.com) in what they describe as "a visually rich format designed for the way your brain works." Not everyone's brain works the same way, of course. I usually find "visually rich" formats confusing and distracting, but I like this one. They have not used pictures as a substitute for words. Rather, they present material in a variety of ways. They encourage you to read the book with a pencil in hand and to write your own solutions to problems before you read their solutions.
They work their way through problems —with plenty of alternatives and instructive false starts — until you really understand the pattern they are discussing.
The authors are aware that books about programming can be boring. They have succeeded in making this one fun. They assume that you are reading their book because you want to know:
• The patterns that matter.
• When to use them, and why.
• When not to use them.
• The object-oriented design principles underlying them.
If you read their book, I think you will achieve those objectives.
Refactoring to Patterns, Joshua Kerievsky (Addison-Wesley, 2004, 394 pp., ISBN 0-321-21335-1, $49.99, www.awprofessional.com)
Joshua Kerievsky runs a company that specializes in extreme programming (XP). One of the core competencies of an XP practitioner is refactoring (see Micro Review, Nov.-Dec. 1999). Martin Fowler's book, Refactoring: Improving the Design of Existing Code (Addison-Wesley, 1999), puts names on common forms of refactoring and shows how to perform them.
The original Gang of Four book claims that design patterns are targets for refactoring, but Fowler does not make this connection explicit. Kierevsky does so. He also introduces the concept of a before-and-after study of a refactoring.
In studying refactorings, Kerievsky comes back to the principles underlying the design patterns and object oriented design. He writes clearly and patiently. He is an excellent teacher. He moves easily between principles and details.
Books often have forewords by well known names in the field. This book carries that "sales pattern" to a new level. It contains forewords by Ralph Johnson and Martin Fowler and an afterward by John Brant and Don Roberts. It also has blurbs of advance praise from Kent Beck, Erich Gamma, Ward Cunningham, Sven Gorts, Bruce Eckel, Craig Larman, and others.
Fearless Change: Patterns for Introducing New Ideas, Mary Lynn Manns and Linda Rising (Addison-Wesley, 2004, 296 pp., ISBN 0-201-74157-1, $24.99, www.awprofessional.com)
This book addresses a problem that most people can understand and identify with, namely, how to put forth your ideas in a way that maximizes their chance of adoption. Mary Lynn Manns is a management professor who has specialized in introducing new patterns into organizations. Linda Rising is an independent consultant who has worked on several books dealing with software design patterns.
With a nod to Christopher Alexander, the authors set out to identify and discuss 48 patterns for introducing change. These are not deep structural patterns. They are more along the lines of "Ask for Help," "Do Food," and "Whisper in the General's Ear." The authors discuss these patterns and provide examples. The book is an easy read, and well worth the effort if you have ideas you hope to get across.
Software Endgames: Eliminating Defects, Controlling Change, and the Countdown to On-Time Delivery, Robert Galen (Dorset House, 2005, 328 pp., ISBN 0-932633-62-5, $39.95, www.dorsethouse.com)
This book does not use the language of patterns, but it deals with an area of software development that could certainly use some good patterns. Galen defines the endgame as the time between release of the product to the testers and release to customers. This can be a harrowing time, full of traps and pitfalls. Galen calls on his 25 years of experience to provide practical strategies for dealing with the situations that arise.
Galen starts his book by citing two of Jim McCarthy's maxims from Dynamics of Software Development (see Micro Review, Sept.-Oct 1997):
• Triage ruthlessly, and
• don't shake the Jell-O.
Perhaps you could call these patterns. The first asks you to develop excellent judgment about which defects are worth fixing. The second asks you to develop a horror of changing anything that doesn't need to change. As Galen puts it, "triage and change management are central to a successful exit from the endgame."
This book is a little longer and more detailed than the typical Dorset House book, but the subject warrants it. If you get one good idea out of this book, it could save your company.
Working Effectively with Legacy Code, Michael Feathers (Prentice Hall, 2005, 456 pp., ISBN 0-13-117705-2, $44.99, www.phptr.com)
If the endgame seems harrowing, it's nothing compared to the problems of dealing with legacy code. Nobody wants to touch it, but what do you do if you have to?
Michael Feathers works with Object Mentor, where he teaches classes in many aspects of software development. This book grew out of some of those classes.
As Robert Martin writes in the foreword, dealing with legacy code is like removing rot or reversing entropy. These are difficult tasks for which there are no magic bullets. Feathers provides strategies, but you can follow them with all the best intentions and still get into big trouble. Still, if you have to go into the jungle, it's good to have a guide.
Feathers starts with a brief discussion of principles. About 90 percent of the book is a set of short essays focused on specific problems that you might face. He addresses nitty-gritty issues such as what to do if you find yourself making the same change in many different places.
If you don't have to deal with legacy code, consider yourself lucky. If you do, you'll probably find this book helpful.
A Semantic Web Primer, Grigoris Antoniou and Frank van Harmelen (MIT, 2004, 258 pp., ISBN 0-262-01210-3, $40.00, www.mitpress.mit.edu)
The semantic Web is a term that encompasses a variety of efforts to make information in Websites more easily read by machines. Search engines like Google make the Web usable, but they often return both too many and too few references. Lots of barely relevant information may come back to you, while highly relevant nuggets remain hidden.
While huge amounts of information about the semantic Web are freely available online, Antoniou and Harmelen have put together a concise introduction that emphasizes the resource description framework (RDF), its associated RDF schema, and the Web ontology language, called OWL — no doubt in homage to A.A. Milne's Owl, who spelled his name WOL.
The book starts from the basics, but parts of it are fairly technical. Some aspects of knowledge management are difficult, but the authors do not shy away from them. If you want to know about the semantic Web, this is a good place to start.
Mind Hacks: Tips and Tools for Using Your Brain, Tom Stafford and Matt Webb (O'Reilly, 2004, 394 pp., ISBN 0-596-00779-5, $24.95, www.oreilly.com)
This is a very interesting book, but it's a stretch to include it in the O'Reilly Hacks series. The authors have dutifully broken down their subject matter into 100 relatively independent essays, but it might fit better into a more traditional presentation.
Tom Stafford is a psychologist. Matt Webb is an engineer. They are British, as are nearly all of the 18 people they list as contributors. They refer to the subject matter of their book as recreational neuroscience. They provide a collection of optical illusions, puzzles, and sensory-motor experiments that you can use to gain greater insight into how your brain and nervous system work.
The authors follow a pattern for each hack. They talk about the general area. Then they tell you what to do. Finally, they tell you about the underlying mechanism. It may not have much to do with hacking, but it's fun and informative.