Tuesday, December 20, 2005

Year End Cleanup

This article appears in slightly different form in the November/December 2005 issue of IEEE Micro © 2005 IEEE.

I see far more books than I have time to write adequate reviews of. This time, I point you to a number of books that I hope I'll have time to do justice to some day. Experience tells me, however, that some day rarely comes. More books come in, and other priorities intervene, so I'll probably never get back to these. But they are too promising to pass by without comment.
 
Programming Practices

Prefactoring -- Extreme Abstraction, Extreme Separation, Extreme Readability by Ken Pugh (O'Reilly, Sebastopol CA, 2005, 238pp, ISBN 0-596-00874-0, www.oreilly.com, $29.95)

Refactoring entails changing the internal structure of code without changing its external behavior. The objective might be to make the code more maintainable or to accommodate an extension. Pugh uses his experience of refactoring to arrive at prefactoring, that is, design principles that anticipate these objectives. Using prefactoring principles can reduce the need for refactoring, thus saving time and effort later in the project.

Of course, many books on programming style have stressed the need for maintainability and extensibility. Some of them predate extreme programming, refactoring, design patterns, or even object oriented programming by many years. What distinguishes Pugh's book is that he assumes that you will be using object oriented programming and many of the design and testing principles that characterize extreme programming. I find it interesting to compare this book to Joshua Bloch's Effective Java (Micro Review Jul/Aug 2002). They are both about writing better code, but Pugh's book is not so intimately tied to a specific computer language. It focuses on the entire development process, not just the code, and it does so within the context of specific application problems.

Pugh illustrates his principles with an example that he follows through most of the book. He invents a client, Sam, who runs a lawnmower and music CD rental business. Pugh and his partner, Tim, work with Sam and each other to provide a system for keeping track of rentals.

Here is one example of a design issue that comes up in Pugh's imagined work with Sam. After the system design has advanced sufficiently to have a class representing customers and a class representing music CDs, Sam introduces new requirements that mean that the system should know which customers have rented a certain CD and which CDs have been rented by a certain customer. Rather than keeping that information in one class or the other, Pugh introduces the principle Decouple with Associations. This leads to association classes that keep track of each coupling of a customer and a CD for a specific period of time.

I was delighted to find that Pugh advocates a design principle that has been around for a long time. Pugh states his principle as Separate Policy from Implementation. I don't remember the source, but in the 1960s, that principle took the form don't build policy into the code.

Pugh advocates one principle that I understand but dislike. He likes highly specific method names, such as read_line_up_to_new_line_and_toss_new_line, so that you don't have to look at the method to see what it does. For the same reason, he doesn't like overloaded methods. By using unique names, you can make the methods describe themselves.

Pugh has had a long career and has lots of wisdom to share. This short book will definitely repay the time you spend reading it. 


Core Security Patterns -- Best Practices and Strategies for J2EE, Web Services, and Identity Management by Christopher Steel, Ramesh Nagappan, and Ray Lai (Prentice Hall PTR, Upper Saddle River NJ, 2005, 1088pp, ISBN 0-13-146307-1, www.phptr.com/smp, $59.99)

I started reviewing books in the Sun Microsystems Press Java series from Prentice Hall almost ten years ago. These books are comprehensive and authoritative, and this one is especially so. Christopher Steel is a well known security consultant. He was chief architect of the United States Treasury's Pay.gov project. His co-authors are software systems architects at Sun. They specialize in the technologies that underlie effective security.

The underlying message of the book is that you must build security into your applications. The current widespread practice of adding security after the fact is the cause of many of the security nightmares we are all familiar with. Building security into applications means using successful patterns and technologies. Of course, even before that, it means understanding the security issues that can arise in the kinds of networked applications that our society depends upon.

This book describes the problems to be addressed in the various application layers, explains the patterns and best practices that can help you address those problems, and points to the technologies you can use to implement the resulting strategies. The authors show you how to transform a chaotic and intractable problem into one that is difficult but manageable.

If you are involved in any way with enterprise software, this book belongs on your shelf.


C# Precisely by Peter Sestof & Henrik I. Hansen (MIT, Cambridge MA, 2005, 214pp, ISBN 0-262-69317-8, mitpress.mit.edu, $19.95)

If you have used Java Precisely (now in its second edition) by Peter Sestof, then you know what to expect from this book. It is a reference, not a textbook. Most of the brief reference sections have accompanying code examples. 

As I look at the two books side by side, I find it interesting that C# Precisely is almost twice as thick as Java Precisely. I'll let you draw your own conclusions from that.

If you already know C# but want to look up the rules and see a code example for, say, explicit interface member implementations, all in about half a page, this is the book for you.


Communicating

Reviewing PDF Documents in Acrobat -- Visual QuickProject Guide by Donna L. Baker (Peachpit, Berkeley CA, 2005, 126pp, ISBN 0-321-32119-7, www.peachpit.com, $12.99)

Peachpit's Visual QuickStart and Visual QuickProject guides are a marvelous resource for visual learners. If you find that a picture is better than a thousand words, this series of books is for you.

This book follows a simple Adobe Acrobat use case: Create a PDF file representing a document that you plan to publish. Invite reviewers to annotate the file with their comments. Read and evaluate the comments, and incorporate them into a final version.

Many people already do this, but gingerly and minimally, because they have only learned a few essential Acrobat features. Baker covers all of the Acrobat features that pertain to this task. If you'd like to use Acrobat and PDF more effectively to facilitate your review process, and if you're a visual learner, you should read this book.



No Nonsense XML Web Development with PHP by Thomas Meyer (Sitepoint, Melbourne Australia, 2005, 368pp, ISBN 0-9752402-0-X, www.sitepoint.com, $39.95)

Thomas Meyer is a consultant who specializes in developing dynamic websites that use XML and databases to manage the underlying content. He envisions his audience for this book as "intelligent and curious, with a wide range of technical proficiency, but all feeling a little overwhelmed by the terminology, processes, and technologies surrounding XML." 

Meyer uses the book to develop an XML-powered website, while teaching you what you need to know about XML. The "no nonsense" part of the title refers to the fact that he leaves out many important aspects of XML that don't pertain directly to the task at hand. For example, he talks about document type definitions (DTDs) but not XML schemas. He talks a lot about Xpath, but says nothing about Xquery or Xlink.

If you work your way through this book, you will understand how to use XML and PHP to manage the content of a website. You will also have a sound basis from which to explore other aspects of XML as you expand your website's capabilities.


Document Engineering -- Analyzing and Designing Documents for Business Informatics and Web Services by Robert J. Glushko  Tim McGrath (MIT, Cambridge MA, 2005, 724pp, ISBN 0-262-07261-0, mitpress.mit.edu, $34.00)

Robert Glushko leads the Center for Document Engineering at UC Berkeley. Tim McGrath is an independent consultant and chair of an Oasis Universal Business Language subcommittee.

This book is at the opposite pole from the "no nonsense" book I review elsewhere in this column. It treats its subject exhaustively and abstractly in a way that will surely prove daunting to most potential readers.

While many people use the phrase document engineering, Glushko and McGrath define it as an approach, not a methodology. They see Document Engineering as a discipline, defined by this book, that applies equally to documents that carry data between business applications and documents that carry information or instructions to human readers in a business context.

As best I can tell, this book describes an approach to designing loosely coupled message-driven business systems, with special emphasis on the messages. The successful document engineer, according to the authors, can come from any discipline that teaches people to think abstractly and reason about information and processes. If this sounds like something you're interested in, then consider buying this book. 


Living on the Web

Ambient Findability by Peter Morville (O'Reilly, Sebastopol CA, 2005, 204pp, ISBN 0-596-00765-5, www.oreilly.com, $29.95)

In The World is Flat (Micro Review, May/June 2005), Tom Friedman lists in-forming as one of his ten flatteners. By this term Friedman refers to the powerful search tools that make huge amounts of information quickly available on demand. Friedman glosses over this flattener, but Peter Morville delves deeply into it.

The biggest problem with this book is figuring out exactly what it's about. Jakob Nielsen says in a blurb on the back cover that it puts search engine marketing into a larger context and provides insights into human behavior. The author says in his preface that he doesn't know what the book is about or whom it's for. He asks you to read it, then send a copy to anyone who should read it. 

If you want to understand how networks and ubiquitous computing are changing our world, read this book. You may not be able to summarize it, but it will give you a lot of information quickly and painlessly.



The Symantec Guide to Home Internet Security by Andrew Conry-Murray & Vincent Weafer (Addison-Wesley, Boston MA, 2005, 240pp, ISBN 0-321-35641-1, www.awprofessional.com, $19.99)

We all love the convenience of being connected to the vast resources of a networked world, but that convenience is increasingly balanced by danger. Many of us will never be security experts. We have a few tools that we rely on for our personal business, entertainment, and communication. They come out of the box with a variety of protections, and they continually update themselves. Nonetheless, there are still risks, and most of us have no idea how to assess, mitigate against, or devise contingency plans for those risks.

The authors, a writer and a security researcher, offer this book as "a comprehensive resource for the broad range of risks that Internet users face." If you use computers in your personal life, you should look at this book.


The eBay Survival Guide -- How to Make Money and Avoid Losing Your Shirt by Michael Banks (No Starch, San Francisco CA, 2005, 284pp, ISBN 1-59327-063-1, www.nostarch.com, $19.95)

More that a hundred million people have used eBay, the online auction site. There is a tremendous potential benefit from buying or selling there. Many people do so successfully with no formal training, but a few tips and tricks can be worth hundreds of dollars.

This book assumes that you can figure out how to navigate the site and handle the mechanics of buying and selling. It focuses, according to the publisher, on "how to get the best price if you're selling; how not to overpay; and how not to get ripped off."

Wednesday, August 31, 2005

Database Theory

This article appears in slightly different form in the July/August 2005 issue of IEEE Micro © 2005 IEEE.

Relational databases are everywhere, but many of the people who work with them know little of the underlying theory. One of the best known authorities in this field wants to change that state of affairs.

Database in Depth -- Relational Theory for Practitioners by C J Date (O'Reilly, Sebastopol CA, 2005, 228pp, ISBN 0-596-10012-4, www.oreilly.com, $29.95)

In 1969, as is true today, most commercial data processing applications relied on some sort of database management software. A great deal of thought had gone into their development, but they seem ad hoc and overly complex by today's standards. In that year an IBM mathematician, the late E F (Ted) Codd, developed a system, called the relational model, to allow him to attack the problems of database management rigorously. Over time, Codd's model became the basis for all serious database management. 

Chris Date, another mathematician, was an early adopter of the relational model. His An Introduction to Database Systems, now in its eighth edition from Addison-Wesley, first appeared in 1975. It is the standard college textbook on the entire database field. His Databases, Types, and the Relational Model: The Third Manifesto, co-authored with Hugh Darwen and soon to appear in its third edition from Addison-Wesley, is a graduate-level discussion of how to carry forward and extend Codd's principles as database systems evolve. In it he tries to lay a firm foundation for "object-relational" database management. 

The current book lies between these two. It is more advanced and more focused than the former, but chattier and more suitable for self-study than the latter. Date carefully explains how he has positioned these books, lest you be tempted to rely on one of them to do the job of the others. If you're serious about database management, you should have all three.

As relational database management systems became widespread, the various commercial vendors began to diverge from the original model. Much of this divergence became embodied in the SQL language. As an aside for those who care about such things, the name SQL originally stood for Structured Query Language, and many practitioners pronounced it Sequel. In its standardized versions, however, the name does not stand for anything. It is just the three letters S-Q-L, and that is the way Date pronounces it, though he acknowledges that the other pronunciation is still widespread. 

The problems with SQL have little to do with its name. They arise from its abandonment of fundamental principles. For example, SQL fails to keep the data model separate from its implementation. Its basic structures are tables, which differ from relations in that they have ordered rows and columns and can have duplicate rows. They differ in other ways too, but you'll have to read Date's book to find out. 

Date prefers to use the language Tutorial D, which he and Darwen define in the Third Manifesto book. Date believes that the original relational model does not need to -- in fact, should not -- change to accommodate object-oriented features. The original model deals with relations on domains. Domains are arbitrary sets, and a relation on domains T1, . . ., Tn is approximately a set of sets, {t1, . . .,tn}, plus a mechanism (based on a heading and annotations in the body) that allows elements to maintain their identities as members of their respective domain sets. A theory of types and inheritance adds structure to the set of domains. Date regards this structure as orthogonal to the original relational model, because the original model assumes nothing about the domains. The mainfesto uses the term D to represent any language that
  • preserves the original model
  • provides the orthogonal object-oriented extensions called for by the manifesto
Tutorial D is a specific example of D. That means that Tutorial D (unlike SQL) is relational and that it provides object oriented features in a way that is orthogonal to the relational model.

This book uses Tutorial D in places, but it does not go into detail about the theory of types. It focuses on providing a brief, but not terse, presentation of the original relational model, contrasting it with current commercial products and discussing contentious issues such as the wisdom of allowing null attributes. It contains a large number of thought provoking exercises. An O'Reilly website provides provides answers and further discussion. One drawback of the book is its poorly designed index. O'Reilly should invest in a good one for the next printing.

Date complains about the product-oriented nature of computer science instruction, which leads to a number of widespread misconceptions about the relational model. He hopes by his presentation, which relies on principles rather than the quirks of SQL or specific products, to correct these misconceptions and produce a greater understanding of and appreciation for the relational model. 

To help you decide whether you need to read this book, Date suggests that you try to answer the following questions:
  1. What exactly is first normal form?
  2. What's the connection between relations and predicates?
  3. What's semantic optimization?
  4. What's a join dependency?
  5. Why is semidifference important?
  6. Why doesn't deferred integrity checking make sense?
  7. What's a relation variable?
  8. What's nonloss decomposition?
  9. Can a relation have an attribute whose values are relations?
  10. What's the difference between SQL and the relational model?
  11. Why is The Information Principle important?
  12. How does XML fit with the relational model?
Date does not specify the number of questions you must answer correctly to be exempt from reading the book. I suspect that many experienced practitioners will fall far short of 100%. If you are in that category, or if you just want a clear account of the relational model and its underlying principles, you should read this book.

Saturday, June 25, 2005

The World is Flat

This article appears in slightly different form in the May/June 2005 issue of IEEE Micro © 2005 IEEE.

Friedman's Flat World

The World is Flat: A Brief History of the Twenty-First Century by Thomas L. Friedman (Farrar, Straus, and Giroux, New York NY, 2005, 496pp, ISBN 0-374-29288-4, www.fsgbooks.com, $27.50)

Tom Friedman is a New York Times columnist who has won the Pulitzer Prize three times. He often appears on in-depth interview programs like Charlie Rose or C-SPAN's Book TV. He has an optimistic and enthusiastic manner, which is built on the confidence that comes from doing the underlying journalistic work.

Friedman addressed globalization with his book The Lexus and the Olive Tree: Understanding Globalization (FSG, 1999). In that book he noted that half the world was trying to make excellent products that they could sell worldwide, while the other half was fighting over who owns which olive tree. After the terrible attacks of September 11, 2001, however, Friedman focused almost entirely on the Middle East (the olive tree side of that book) until early in 2004 when he looked around and noticed that a great deal had happened on the Lexus side. He set about to understand and explain the new developments, and this book is the result.

Friedman's melodramatic title is beautifully matched by a dust jacket featuring Ed Miracle's lithograph I Told You So. Friedman's title represents his discovery that the "playing field" is much larger and more level than he had realized. That playing field does not, however, encompass the whole world. Friedman acknowledges this late in the book and admits that his rosy picture of globalization has a dark side. He has suggestions for addressing the dark side, but they depend on an understanding of his flat world.

Friedman equates the flat world with a rising spiral of horizontal collaboration. This arises from a convergence of the following factors:
  • Synergistic interaction of what Friedman calls the ten flatteners.
  • Widespread adjustment of business practices to accommodate the flatteners.
  • Three billion new players on the field.
Friedman's flatteners are a little arbitrary, but I think they cover the ground pretty well. They are the following, roughly in chronological order.

The fall of the Berlin Wall on November 9, 1989 marked a big step toward worldwide unity. One of the world's two main economic systems had collapsed, leaving just one viable model. This was tremendously liberating for both India and China, as well as the 600,000,000 inhabitants of the former Soviet empire. By an odd coincidence, roughly the same date marked the emergence of Windows 3.0 -- not a very good operating system by today's standards, but good enough to become the worldwide standard.

The Netscape initial public offering on August 9, 1995, is the signpost for Friedman's second flattener. The browser made huge numbers of public sites available to anyone with a modem and a PC, practically anywhere in the world. Just as important, the Netscape offering kicked off the dotcom bubble, resulting in vast amounts of fiberoptic cable providing high-speed communication between the United States and much of the rest of the world, including India. When the bubble burst, companies were able to use this cable for very little money.

The third flattener is the development of what Friedman calls work flow software. By this he means the XML-based protocols that allow software packages to communicate. The loose coupling that this architecture provides has allowed many ad hoc collaborations between software packages that were never designed to collaborate.

The fourth flattener is the open source movement. Friedman tells the story of Apache, which has enabled companies to use a worldwide free standard as the basis for their application servers, then add (and charge for) their own bells and whistles. He distinguishes this from the Gnu/Linux model in which it is much harder for companies to charge for their add-ons. Both of these models make world class software available free to anyone in the world, and they also serve to keep the prices of competing commercial products low.

The next four flatteners describe business practices that exemplify horizontal collaboration. Flatteners five and six are outsourcing and offshoring, practices that many people confuse. Outsourcing describes the identification of discrete business modules that can be done elsewhere and the delegation of those modules to other companies. Offshoring entails moving an entire operation to another country, but keeping control of it. 

Outsourcing to Indian firms, according to Friedman got a big head start during the Y2K scare. Many United States companies outsourced their Y2K repairs to Indian firms because they simply couldn't find enough workers and enough money to do the work in the US. This built the reputations of many Indian firms for high quality work at low cost. Then, when the dotcom bubble burst and US firms had a lot less cash, they turned to India out of need, but with confidence, for many of their software development needs. And the abundance of fiber-optic cable made the collaboration much easier than it would have been otherwise.

Friedman's discussion of offshoring focuses on China. That country, with its authoritarian structure, was able to impose a change in its economic system from the top down. All it took was for Deng Xiaoping to say "Black cat, white cat, all that matters is that it catches mice. To get rich is glorious." As we all know, however, top down changes don't always percolate smoothly to the bottom. Many firms got burned before they learned the best strategies for offshoring to China, but many US firms now have highly successful and profitable operations in China.

The seventh flattener is supply chaining. Friedman describes the far-flung Dell supply chain that produced the notebook computer on which he wrote the book. He also describes the intimate relationship between WalMart and its suppliers. Not only does WalMart integrate its suppliers' workflows into its own, but it feeds information about sales back to its suppliers to help them improve their offerings. Of course, this relationship gives WalMart extraordinary leverage over its suppliers, and WalMart uses this leverage to full advantage.

Friedman calls the eighth flattener insourcing. You could call it outsourcing as seen from the vendor's point of view, but it is qualitatively different. If you call Toshiba to report a problem with your laptop, they tell you to take it to UPS. UPS, however, does not deliver the laptop to Toshiba. Instead, UPS repairs the laptop at its own hub and delivers it back to you. This is just one of many examples of how UPS encourages its package delivery customers to outsource functions that happen just before or after package delivery to UPS.

The ninth flattener is Google and related services. Anybody can find out practically anything from anywhere at any time. This automates and expands what assistants or librarians used to do. As Friedman points out, when Colin Powell wanted to look at UN Resolution 242, he didn’t need to call an aide. He just Googled it. Powell's aides had to find other ways to add value. 

The availability of powerful search capabilities has many implications for ordinary citizens. A great deal of personal history and information is readily available to potential employers, lenders, or even acquaintances. And your mistakes will follow you forever.

Friedman rounds off his ten flatteners with one he calls the steroids. By this he means that computers provide greater MIPS, more memory, and faster I/O. File sharing, multipurpose devices, voice over IP, and wireless communication all work to supercharge the other flatteners.

For Friedman's triple convergence, the ten flatteners reinforce and amplify each other. Businesses change their practices to accommodate the new reality. Business, technical, and even liberal arts schools start turning out graduates who are comfortable with the flat world. And the entire populations of China, India, and the former Soviet Union enter the worldwide job market. Of course, not all of these people are prepared to compete in the global marketplace, but Friedman estimates that at least 150,000,000 technically qualified workers who couldn't do so before are now competing directly with US workers. That number is about the size of the US workforce.

Having laid out a picture of the flat world in highly optimistic terms, Friedman tries to address the troublesome points. To do so, he begins with an amazingly prescient excerpt from a work written in 1848, more that 150 years ago. Karl Marx in Das Kapital predicts that capitalism will dissolve national and religious identities to produce a universal civilization governed by market imperatives. Fortunately, this has not happened, but the forces of globalization do provide just that sort of pressure. Friedman contends that we need to distinguish between different categories of obstacles to globalization. Some obstacles are sources of waste and inefficiency. Others are sources of identity and belonging.

The political discussion of a social contract that distinguishes between the bad obstacles and the good ones has to happen at the level of individual countries. Large companies, however, can provide transnational influence. Friedman cites the cases of companies like HP, Dell, and IBM, which have set standards of socially responsible manufacturing practices that all of their suppliers throughout the world must meet. This is one side of the transnational companies. The other side is that being in many countries gives a company the flexibility to avoid the troublesome regulations of any particular country. 

Friedman also sets up a contrast between WalMart and Costco, firms that provide approximately the same services. He notes that WalMart provides much less in the way of health care coverage than Costco. WalMart gives a better return to its shareholders, but states and communities in which WalMart does business may have to pick up the tab for WalMart's underinsured employees. This raises the question of where the boundaries between companies and their surrounding communities lie.

In the 1930s, in the midst of the Great Depression, the United States adopted many laws to protect workers and to provide a social safety net. In addition to laws, though, companies felt a civic responsibility to provide for their workers. Lifetime employment followed by a good pension was common. Local governments kept property taxes low to protect homes. This unwritten social contract pertained for many years, but in the 1970s it started to break down. People saw ways to squeeze the fat out of companies and real estate. Leveraged buyouts led to layoffs, reduced medical benefits, and evaporating pensions. High property taxes and other housing price pressures led to increased homelessness. Without a social contract these trends will continue into the flat world. 

Friedman draws upon his analysis of the flat world to make separate recommendations to the United States, developing countries, and individual companies. Friedman's rules for companies boil down to the following: introspect and collaborate. You should understand all the parts of your business, outsource the parts that you don't really specialize in, and develop the others. This requires you to develop the ability to collaborate as a core competency.

For the United States, Friedman paints a picture of an impending perfect storm. He calls this a quiet crisis, because the storm isn't imminent, but all the factors are in place to make it inevitable if nothing changes. The factors, in brief, are the shrinking numbers of available scientific and technical workers, the fact that other countries are producing higher quality technical and scientific work, and the fact that we are not investing in education and research to a sufficient degree.

Friedman sees similarities to the situation that existed after 1957 when the Soviet Union deployed Sputnik, the first artificial Earth satellite. When President Kennedy spoke to Congress on May 25, 1961, he said:
Let it be clear that I am asking the Congress and the country to accept a firm commitment to a new course of action, a course that will last for many years and carry very heavy costs. . . This decision demands a major national commitment of scientific and technical manpower, materiel, and facilities, and the possibility of their diversion from other important activities where they are already thinly spread. It means a degree of dedication, organization, and discipline which have not always characterized our research and development efforts.
Friedman's quiet crisis demands a similarly serious and honest call to action. In the absense of other leadership, Friedman offers his own doctrine of "compassionate flatism." The essential features of this program are portable pension and health care benefits, opportunities for lifelong learning, and more demanding parents.

Friedman has a lot to say about geopolitics. He talks about the parts of the world that are not flat and explores the reasons why some countries are globalizing while others are not. He presents some strategies for developing countries, and he looks at factors that can work against globalization and even set it back. He draws on his deep knowledge of the Middle East to explain why some countries in that area of the world, aside from oil, contribute more to Osama bin Laden's supply chain than than to those of global companies.

Finally, Friedman poses his Dell theory of conflict prevention. He elaborates it to some degree, but in essence it says that no country that belongs to a major supply chain wants to risk war. There are other suppliers out there, and the if the business goes away, it won't come back soon. He cites the pressure of the Indian IT industry on India's government to persuade it to back away from a conflict with Pakistan. 

Friedman writes colorfully, and there is much to quibble with, but on the whole, this is an incredibly useful book. It contains much more information than I can summarize here. I highly recommend it to everybody. 

Postscript - August 2005

I still recommend the book to everybody, and much of the reaction I've seen to this book is positive. The negative reactions I've seen tend to focus on Friedman's writing style and his rosy view of globalization. I heard one media critic describe Friedman's style as both tortured and goofy, and I have to agree. 

The cover illustration of the softcover version is more subtle and perhaps more appropriate than the melodramatic one on the dust jacket of the hardcover, but I like the melodramatic one better. It is truer to the style of the book. Unfortunately, the publisher could not reach a suitable agreement with the artist, Ed Miracle, so they had to change.

Friedman's rosy view is a bigger problem than his writing style. To be fair, Friedman does address the dark side of globalization, but my review glosses over this part of the book, because it is not Friedman's real focus. While Friedman draws attention to some of the darker consequences of globalization, he provides no insightful analysis. His great insight is into the mechanisms of globalization. He regards these mechanisms as inexorable technological forces that we must all learn to live with and use to our advantage.

The way to address the problems of globalization is to develop local and global social contracts. This entails widespread thought, discussion, and negotiation. Friedman's book can help by providing a common understanding of the facts and mechanisms of globalization. An interesting case in point is the reaction to the Chinese government's offer on June 22, 2005 to purchase the Unocal oil company for 18.5 billion dollars. Friedman addresses the problem of the coming oil shortage and strongly advocates steps to avert it. He suggests a joint US-Chinese program, with the urgency of the Manhattan project, to find and move to alternate energy sources. This is much more likely to be effective than the easier step of giving speeches about foreign ownership of US companies. 

Monday, April 25, 2005

Thinking About History and Design

This article appears in slightly different form in the March/April 2005 issue of IEEE Micro © 2005 IEEE.

History

Many of us have artifacts of our lives stored away in closets, drawers, cellars, garages, and other places that we intend to clean out and organize some day. Many of us have heard inside stories over the years and wish that somebody would write them down. 

In an industry concerned with the future, few take time to consider the past. Myths grow up and, if unchallenged, become history. The two books I look at here focus on events that are worth thinking about.


Revolution in the Valley -- The Insanely Great Story of How the Mac Was Made by Andy Hertzfeld (O'Reilly, Sebastopol CA, 2004, 291pp, ISBN 0-596-00719-1, www.oreilly.com, $24.95)

Andy Hertzfeld was present at the birth of the Macintosh. He has cleaned out his garage and written down the stories of the time. Hertzfeld joined Apple in February 1981 and left in March 1984, when he went on a leave of absence and, for reasons he details in the book, did not come back. When he decided to record his recollections, he set up www.folklore.org, so he could compare notes with others who had been there.

I find this book fascinating. Reading about the people and the public events of the early 1980s brings back many memories for me. During the time when Hertzfeld was at Apple, the principal microprocessor vendors were Intel and Motorola. I worked for two of the others: Zilog and National Semiconductor, both of which had offices near Apple's. In January, 1984, when the famous Macintosh ad appeared during the Super Bowl, my article, "1984: The Year of the 32-Bit Microprocessor" appeared in Byte Magazine. 

I obtained my first Macintosh in 1984, and I used Macintoshes almost exclusively until the early 1990s. I remember the day Andy Hertzfeld came to a meeting of Berkeley Macintosh Users Group to demonstrate his Switcher program. That all seems so long ago, but I enjoyed reading Hertzfeld's account of the bad design decision that made a program like Switcher necessary. 

One of the many old books I have lying around is The Macintosh Basic Handbook by Thomas Blackadar and Jonathan Kamin (Sybex, 1984). This book describes a product that never saw the light of day, because of certain dealings that went on between Apple and Microsoft. I enjoyed reading Hertzfeld's account of those dealings and the repercussions inside Apple. Macintosh Basic was an excellent program for its time. I wish I could have had a chance to play with it. 

While the book is fascinating, there are parts that are depressing. For example, Hertzfeld writes about his bad performance review. His technical work was fine, but he was "too big for his britches" and continually went over his boss's head. His boss told him to stop talking to Steve Jobs. All of this reminds me of similarly sordid corporate power games that I have seen first hand. 

In Micro Review, May/June 2000, I reviewed Jef Raskin's book The Humane Interface and alluded to the widely held belief, or perhaps legend is a better word, that Raskin is "Father of the Macintosh." Hertzfeld examines that belief and concludes that it is not really accurate, though he does give Raskin a lot of credit for his contributions. Hertzfeld concludes that Steve Jobs deserves the title. It's hard to argue that point.

Hertzfeld's book, like many others, presents a mixed picture of Steve Jobs. Jobs is the brilliant visionary who sees what the product might become. He is also the quirky manager who promulgates Sayings from Chairman Jobs. A maxim like "It's better to be a pirate than join the navy" captures the Jobs style.

This industry has produced more than one quirky personality, so it's interesting to read about some of their interactions. For example, after Adam Osborne taunted some Apple employees at the 1981 West Coast Computer Faire, Jobs called Osborne and left a message with his secretary saying "Tell him the Macintosh is so good that he's probably going to buy a few for his children even though it puts his company out of business." Of course, Osborne put his own company out of business by obsoleting his cash cow, the Osborne 1, then failing to deliver its successor. And Osborne never saw the value in making a portable clone of the IBM PC.

Another interesting confrontation occurred between Jobs and Bill Gates, after Microsoft had announced Windows in November 1983 -- ten years before there was a decent working version. When Jobs accused Gates of stealing Apple's ideas, Gates replied, "We both had this rich neighbor named Xerox, and I broke into his house to steal the TV set, only to find that you had already stolen it."

The failed relationship between Steve Jobs and John Sculley is well known. Hertzfeld gives a clear picture of the situation that led to the confrontation in which Sculley removed Jobs from his executive position.

My favorite Steve Jobs story from the book concerns his attempt, seven months before the Mac was due to ship, to clone Sony's 3.5 inch floppy drive, rather than buying drives from Sony. This plan ultimately failed. Fortunately, the team anticipated this and continued to work secretly with the Sony engineers. At one point they had to hide a Sony engineer in a closet to keep Jobs from seeing him.

I have my own small Steve Jobs story. I remember the day I attended a big press event for NeXT computers. Steve Jobs promised to send me a NeXT machine to review for Micro, but he never did. He did give me a nifty Wingz World Tour jacket, though. In case you don't remember, Wingz was a spreadsheet designed for the NeXT machine. Somewhere I have a book about Wingz, though I don't believe it ever became commercially available.

Hertzfeld and Jobs are not the only players in this story. There are others I haven't mentioned, but Hertzfeld includes many anecdotes about them. This book is a collection of anecdotes, but together they give depth and color to the story of the Macintosh.


They Made America -- From the Steam Engine to the Search Engine: Two Centuries of Innovation by Harold Evans (Little Brown, New York NY, 2004, 496pp, ISBN 0-316-27766-5, www.twbookmark.com, $40.00)

According to the publisher, Harold Evans was the editor of the Sunday Times of London for fourteen years and then the Times of London before settling in 1984 in America, where he has held a number of important publishing positions. In 2002, Britain's journalists voted Evans the greatest all-time British newspaper editor. He was knighted in Queen Elizabeth's 2004 New Year honors list. He lives in New York with his wife, Tina Brown (famous in her own right), and their two children.

In this book Evans brings his impressive journalistic talent to bear on an area that many consider America's greatest strength, namely, its ability to nurture and reward innovation. He tells the stories of innovators from the country's earliest days to the present.

This massive coffee table book is extremely interesting, but I am focusing on one small part of it: the story of the late Gary Kildall and his role in the personal computer revolution. Gary Kildall's company, Digital Research, made the CP/M operating system, which almost became the operating system for the IBM PC. Many people have heard the (untrue) story of how Gary Kildall chose to go flying instead of meeting with the IBM lawyers, so they chose Microsoft as their supplier instead.

I only visited the Digital Research headquarters at 801 Lighthouse Avenue in Pacific Grove once, in the very early 1980s. Starting from Cupertino, I drove the beautiful mountain roads to Pacific Grove. I came to pick up the Olivetti M20 personal computer that Digital Research had used to develop a Z8000-based version of CP/M. I had written a book about the Z8000, and Olivetti gave me the machine in hopes that I would write a book about the M20. I never wrote the book, but I ran a floating point benchmark on the M20 for Jerry Pournelle's survey. I still have the M20.

On that visit to the Digital Research headquarters, I experienced the wonderful relaxed west coast atmosphere and idyllic setting that must have seemed so foreign to the east coast IBM lawyers when they came to call. Contrary to legend, Gary Kildall did not stand them up, but the informal setting may have given the lawyers the impression, which later proved to be true, that they could take advantage of Kildall and get away with it. The full story is long and sordid, and Evans goes through it in detail. He draws on many sources, including Gary Kildall's unpublished memoir.

Telling Kildall's side of the IBM PC story is important, but I think that a more valuable and lasting benefit of Evans' research about Gary Kildall is to highlight the large and important influence that this brilliant, thoughtful, gentle man had on our industry. From the 1960s to his untimely death in the 1990s, Kildall never stopped working to make computers available to people. 
  

Interaction Design

Thoughtful Interaction Design -- A Design Perspective on Information Technology by Jonas Löwgren & Erik Stolterman (MIT, Cambridge MA, 2005, 212pp, ISBN 0-262-12271-5, mitpress.mit.edu, $39.95)

Jonas Löwgren is Professor of Interaction Design at Malmö University, and Erik Stolterman is Professor of Informatics at Umeå University, both in Sweden. As you might expect, their book has a strong flavor of academia. It would certainly have benefited from the guidance of a good technical editor. They say at the start of their final chapter, "It is perfectly possible that this book seems diverse and incoherent so far," and I am forced to agree that it does. Nonetheless, it contains many nuggets of insight, and even some useful advice.

One of the oddest aspects of this book is its references to Robert Musil's great unfinished novel, The Man Without Qualities. Musil's ideas about thinking and creation resonate with the authors' ideas about interaction design. They even borrow his title and say that information technology deals with a material without qualities.

The key point I take from this book is that designing digital artifacts is difficult. You cannot prescribe simple rules and a definite methodology for doing this kind of design. Instead, you must inform yourself of many general considerations, then think about the situation before you. Your deep knowledge of the design process and your design ability will help you to see the larger context and contrive digital artifacts that fit that context.

This is a thin book, but not one that you can read casually. If you are in the business of interaction design, you should at least glance at this book. I don't know of another that takes the same point of view.

Friday, February 25, 2005

Too Much Information

This article appears in slightly different form in the January/February 2005 issue of IEEE Micro © 2005 IEEE.

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 simply 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 ten 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 by Eric Freeman & Elisabeth Freeman (O'Reilly, Sebastopol CA, 2004, 676pp, ISBN 0-596-00712-4, www.oreilly.com, $44.95)

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 by Joshua Kerievsky (Addison-Wesley, Boston MA, 2004, 394pp, ISBN 0-321-21335-1, www.awprofessional.com, $49.99)

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. All those people have read this book, and you haven't? What are you waiting for?


Fearless Change -- Patterns for Introducing New Ideas by Mary Lynn Manns & Linda Rising (Addison-Wesley, Boston MA, 2004, 296pp, ISBN 0-201-74157-1, www.awprofessional.com, $24.99)

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 manaagement 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, but 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 by Robert Galen (Dorset House, New York NY, 2005, 328pp, ISBN 0-932633-62-5, www.dorsethouse.com, $39.95)

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 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
  • 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 by Michael Feathers (Prentice Hall, Upper Saddle River NJ, 2005, 456pp, ISBN 0-13-117705-2, www.phptr.com, $44.99)

If the endgame seems harrowing, it's nothing when 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. The bulk of the book -- about 90% -- 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.

 
Miscellany

A Semantic Web Primer by Grigoris Antoniou & Frank van Harmelen (MIT, Cambridge MA, 2004, 258pp, ISBN 0-262-01210-3, mitpress.mit.edu, $40.00)

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 by Tom Stafford and Matt Webb (O'Reilly, Sebastopol CA, 2004, 394pp, ISBN 0-596-00779-5, www.oreilly.com, $24.95)

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.