Dr. Dobb's Journal June 2003
Ever since I heard that a new edition of John Robbins's book on Windows debugging was coming out, I've been pestering him for a copy. It finally landed in my inbox a couple of weeks ago, and it was well worth the wait. On the the face of it, Debugging Applications for Microsoft .NET and Microsoft Windows ought to be obsolete after a year or two, because of the rapid evolution of Microsoft technologies. But if you read it closely, you discover lessons for anyone who has code to fix on any kind of platform. Robbins (who writes the popular "Bugslayer" column for MSDN) starts gently by looking at where bugs come from, and how they can be prevented. (After all, the easiest mistake to fix is the one that you don't make.) By Chapter 3, though, he is rebasing DLLs and tracing in Windows forms. Chapter 4 explains in detail how Win32 debuggers work; Chapter 5 describes the advanced features of the Visual Studio .NET debugger, and only then do we get into the section titled "Power Debugging." Later chapters cover such things as extending Visual Studio .NET, deadlocks in multithreaded code, tracking down memory-management bugs in the C run-time library, and so on. The whole package is rounded out by a CD-ROM full of useful software, most complete with source code.
This book is not for the faint of heart, but I think that everyone who reads it will learn from it, even if they never touch a Windows machine in their life. Robbins repeatedly emphasizes the importance of building tools, and of understanding what's going on one level below where your problem is. Despite having done some pretty serious Windows programming in the past six years, I learned almost as much about .NET and Windows from this book as I did about debugging.
The second book this month is Robert Glass's Facts and Fallacies of Software Engineering. The blurb on its back says, "You will experience moments of 'Oh, yes, I had forgotten that,' alongside some 'Is that really true?' thoughts," and that's a pretty accurate summary. Glass presents 55 facts (some of which are a little fuzzier than anything I'd call a "fact," but never mind), and 10 fallacies under headings such as "Management," "Reuse," and "Testing." What's more, he also cites some of the evidence we have to back up these statements.
Some of what he says is well-known: Good programmers are up to N times better than bad ones (his value for N is 28), reusable components are three times harder to build than nonreusable ones, and so on. Other facts aren't part of the zeitgeist, though they should be. For example, most of us know that maintenance consumes 40-80 percent of software costs, but did you know that roughly 60 percent of that is enhancements, rather than bug fixes? Or that if more than 20-25 percent of a component has to be modified, it is more efficient to rewrite it from scratch?
I really wish someone had given me something like Facts and Fallacies when I took my first programming job. If nothing else, it would have been a better way to start thinking about the profession I had stumbled into than the "everybody knows" factoids that I soaked up at coffee time. I think everyone should at least glance through it, and if some of what it says makes you angry, so much the better. Just be sure that when you send the author an angry e-mail, you have at least as much hard evidence to back up your point of view as he has for his.
The third book this month is Ronald Mak's Java Number Cruncher. This book covers the same ground as most introductions to numerical computingroundoff and underflow, interpolation, approximation, matrix algorithms, and so on. What makes Mak's book stand out is its clarity. The writing and the examples are both very easy to follow, and Mak has a real talent for making the dry and difficult approachable. A heavy font for code and thicker lines for the graphs would make it more readable, but that's a quibble. The next time I have to teach number crunching, I'll probably use this as a text.
Finally, there is Jesse Tilly and Eric Burke's Ant: The Definitive Guide. I'm normally not a fan of books that put words like "Definitive" or "Secrets" in the title, and every time I see "The Zen of XYZ," I wonder when "The Greek Orthodoxy of XYZ" is going to come out. That aside, this book is exactly what O'Reilly & Associates does best. Ant, a modular XML-based replacement for Make, is quickly becoming the standard way to build Java programs. Tilly and Burke describe how it works, how to drive it, and how to extend its functionality with Java plug-ins. Most of the details are in Ant's online documentation, but their explanations are definitely worth the price of the book. Oh, and their code font is nice and readable, too.
DDJ