C/C++ Users Journal January 2004
In 1995, Digital Press published Mike Gancarz's The UNIX Philosophy. Gancarz has followed up in the new millennium with a greatly revised, essentially new work: Linux and the UNIX Philosophy. As Gancarz explains in the preface:
[I]t finally dawned on me. [My book] as a description of the UNIX way of thinking was a "first system." It was now being drawn into becoming a "second system," a...fuller, more developed, more relevant edition of the first.
Sounds deep. Actually, it is.
Linux and the UNIX Philosophy is a book that conceivably could have an impact on the young computer scientist of today comparable to the impact that a book like Thinking Forth (Prentice Hall, 1984, ISBN 0-13-917568-7) had on us then-young computer scientists back in 1980s. Gancarz explores the philosophical basis of UNIX and ends up expounding the computer-science equivalent of what Huxley, Watts, and Isherwood called in the humanities the "perennial philosophy." Simplicity is a virtue. Directness is a virtue. If you keep it clean enough, even users can be taught to use it. We've all spent hours, days, and man-months struggling with managers and team members who couldn't grasp those simple principles!
On another level, this book is painful to read: The pain is nostalgia. "Yes, yes," I want to shout along with the text, "Tell them how it happened so they don't forget. We were there!" Actually, that's pretty much the gist of the "Foreword" by Jon "maddog" Hall. I found the cascade of memories triggered by Gancarz's insightful recital overwhelming memories of decisions made, of paths taken, of paths not taken, ideas good and ideas not so good succeeding or failing according to merit or whims of fate, as our craft, our industry, our art and world usage of the Linux/UNIX operating system(s) blossomed and grew to gargantuan proportions.
Yet, it's more than just a nostalgic trip. Linux and the UNIX Philosophy is a useful book because it recounts, with charming brevity, how an immense corpus of business-mission-critical software emerged in conjunction with the then-industry-novel business model of community-shared intellectual property as represented by GNU/Free Software/Berkeley/Open Source. The inference is that there is some sort of platonic ideal that unites the evolution of the design philosophy of UNIX itself with the advent of the social philosophy of open software.
Not that Gancarz idealizes the operating system itself, as this excerpt from section 7.9 ("Worse is Better") shows:
[T]here is the right way, the wrong way, and the military way.The "UNIX way" is akin to the military way. If you listen to the purists, UNIX should have withered and died 20 years ago. Yet, here it is in its entire parasitic splendor, feeding off the criticisms leveled at it...and growing stronger every day.
This book is not just a windy newsgroup rant: Linux and the UNIX Philosohpy is a first-class folk-history of UNIX and Linux. Many of us might tell the story differently, or may have already told the story differently, drawing at the same time somewhat different conclusions based on our individual roles. But if you're willing to listen to a lover of software coding and design tell the story concisely and engagingly, you couldn't ask for better than this book.
Descending from the ideal to the workaday, Kirk Bauer has delivered a worthwhile volume in Automating UNIX and Linux Administration. In a literary style resembling a rich series of workshops/lectures, Bauer takes you through admin automation starting at the right place secure shells, of course, to zip and zap your commands around the network and ending in the realm of automated backups and restores and the user interfaces for them. Sounds very basic, but maybe you've noticed that:
Uh-huh. Now you're getting it. It's not a question of whether you are interested in what Bauer is selling. It's a question of whether you need it explained to you how this stuff is done. In my experience, the answer is, "Yes, the majority of Linux and UNIX sysadmins in the industry need this refresher." Now, this sort of exposition can be done well or done ill. Bauer does it well. His only visible ideological commitment is to the simple, practical, and inexpensive. So in the end, perhaps this book could be said to manifest the same platonic ideal as Linux and the UNIX Philosophy where the rubber meets the road. The book exhibits good writing, good production values, several quick starts (cvs, for instance), and a good deal of mostly reusable code.
J.J.W.
One of the most sought-after prizes in marketing is to make your company's name synonymous with a particular product. In the United States, people talk about "xeroxing" documents; in the United Kingdom, they speak of "hoovering" the floor. And all around the world, every second, someone is "googling" for something. InfoWorld columnist Jon Udell even talks about a "Google address," which is the combination of terms you type in to get someone, or something, as the first result of a search.
It is, therefore, hardly surprising to find O'Reilly & Associates releasing a book devoted entirely to Google, along with companion volumes on Amazon, eBay, and other dot-success stories. What is surprising is how useful these books are, even to hardcore developers who know what "quoting rules" and "short-circuit evaluation of Boolean expressions" mean. Take Tara Calishain and Rael Dornfest's Google Hacks, for example. The first three dozen or so entries (out of one hundred) explain how to search for material by date, how to find technical definitions, and so on. The authors then cover third-party services built around Google (including a few things that violate Google's terms of service).
Tips 50 through 85 cover the Google API, which lets programs written in Perl, Python, Java, and other languages use Google as an online service. Want to run a popularity contest? Or compare Google's results with those of other search engines? The code you need is right here, along with a lucid explanation of how it works. There are even sections on "Google Pranks and Games" and "The Webmaster Side of Google."
Paul Bausch's Amazon Hacks and David Karp's eBay Hacks have similar structure and content. My copies are already full of yellow sticky notes, and I have copied a fair bit of code from them for use in the courses I teach. (What better way to introduce students to web services than to show them how to program something they use every day?) While all of the material in these books is available online, the authors have done us all a service by collecting and organizing it rather like Google itself does for the Web, when you think about it.
Jeff Johnson's Web Bloopers is just as useful a book as these, though in a very different way. I also suspect that Johnson's content will outlast that of the Hacks books. His first book, GUI Bloopers, taught GUI design by critiquing several well-known programs, and showing what their designers should have done instead. In Web Bloopers, Johnson applies that approach to web sites. Each section puts a name to a common mistake, gives several real-world examples of its occurrence, and then explains what the site's designers should have done instead.
For my money, this approach is much more practical than the "top-down" style of many web-design books (particularly for people with technical backgrounds, like me). As you read the book, you can almost hear Johnson patiently saying, "Okay, let's see...You've repeated information here and here, and these links all lead back to the same place. Perhaps we could reorganize it like this..." A lot of what he says is common sense, but 30 seconds on the Web shows you how uncommon good design still is in practice. If you're interested in fixing that, this book is a great place to start.
Last on my list is Jack Herrington's Code Generation in Action. As the preface says:
The two main constants in software engineering are:
- Programmers' time is valuable.
- Programmers don't like repetitive, boring tasks.
Over the course of 13 chapters, and a handful of appendices, Herrington shows you how to build tools that generate software. Chapter 1 gives a simple case study, an overview of what code generation is, and how to tell if it's the right solution for a specific problem. Chapter 2 then outlines different kinds of code generators, and (importantly) looks at why many developers resist the idea of computer-generated code and how their objections can be answered. The rest of the book then fills in the details of this larger picture and shows how to create code for user interfaces, database layers, unit testing, and so on. Examples are given in a variety of languages (or mixes of languages), along with illustrations to clarify various difficult points.
I liked this book a lot. The simple-minded GUI wizards built into early IDEs may have given code generation a bad name, but when properly used, they are an effective way to manage the masses of boilerplate code in today's distributed multitier systems. If you're a skeptic, this book may convince you; once you're convinced, you will almost certainly find that it makes some part of your working life easier.
G.V.W.