What’s the code actually doing?

Last week, a friend of mine told me that one of his Web servers was brought low when Apache Cocoon, an open source document-publishing framework, filled up a disk volume with a log file. At that point, Cocoon — and the Apache Web server that it fed — quietly shut down.

Solving the problem by flushing the log took only a few minutes once the cause was identified. However, the situation brought out the cautionary tale that if we leverage bits we didn’t write ourselves, we’ll never know everything about how those bits will behave under every circumstance.

That’s not an issue exclusive to open source code, of course; it applies to commercial applications and middleware, Web services, hosted SaaS apps, and applications mashed together using SOA.

And there ain’t nuthin’ you can do about it, other than expect the unexpected all the time.

What about code that your development teams have written? Can you trust that you know everything that it’s doing? Of course not. In many cases, you have no idea what’s really going on behind the scenes. That’s true whenever you use external libraries, or generate code with wizards, or use just about any other feature of today’s higher-level languages.

This point was brought home recently in an excellent talk on machine architecture by Herb Sutter, a C++ guru and software architect at Microsoft. (In his spare time, Herb chairs the ISO C++ standards committee.) His two-hour talk, called “Machine Architecture: Things Your Programming Language Never Told You,” can be watched on Google Video, and should be required viewing for your architects and senior developers.

Regarding his talk, Herb writes, “Would you be surprised to discover that only about 1% (one percent) of all the transistors on your modern CPU exist to ever compute anything? And that the other 99% (ninety-nine percent) of your CPU’s transistors are essentially dedicated to nothing but hiding memory latency? Those are round numbers, of course. But you get the idea…”

Pass this link around your staff. Make some popcorn and set up a group viewing in a conference room. You’ll be glad you did.

And what about that Oct. 10th bug? Last week, I heard about a piece of integation glue logic that failed when, for the first time this year, a date field’s month/day went to four digits (1010). Since every previous instance had been two or three digits, the design flaw in the new mashup app went undetected. Whoops!

Z Trek Copyright (c) Alan Zeichick