Monday, September 15, 2003

Software
The Pragmatic Programmer, by Andrew Hunt and Dave Thomas, is one of my favorite books about the of programming. They distill their advice down to about 70 tips, but three really stand out for me, and I've made them part of my philosophy about my trade.
  • Don't Live with Broken Windows
    Don't leave broken windows (bad designs, wrong decisions, or poor code) unrepaired...Don't let entropy win.

  • DRY - Don't Repeat Yourself
    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

  • It's All Writing
    Treat English as just another programming language.

The combination of the last two is particularly powerful. For years, I've struggled with how to write effective documentation that's both concise and complete, and can be maintained along with the code. Putting those two ideas together helps a lot. So I try to let the code say what it says (this is how it's done), let the UML diagrams and other pictures say what they say (this is what the pieces are, how they're structured, and how they relate), and glue it all together with just enough prose (this is why it is what it is). A crucial tactic in this is to make the software as self-describing as possible - by putting as much application-specific detail as possible in metadata and making the code as simple and clear as I can.

A lot of developers I know believe that all you need is the code, and all you have to do is read it in order to understand the application or system. I disagree; I think that only indicates how immature the discipline of software development really is. I think we need to think of ourselves as writers, not coders, and understand the whole process as a continuum of authorship. And what we produce is writing. And we correct it, enhance it, refactor it, reuse it, and recast it for the whole of its useful life. And we should take pride in making it as easy to understand as possible. The macho attitude of "just read the code" is the attitude of intellectual adolescents.

Critical documentation that is out of date is, of course, another form of broken windows. Don't let entropy win.

Other good books on the craft:

The Practice of Programming, Brian Kernighan and Rob Pike
Facts and Fallacies of Software Engineering, Robert Glass
Refactoring, Martin Fowler
Peopleware, Tim Lister and Tom DeMarco

and the all-time classic:
The Mythical Man-Month, Frederick Brooks - I recommend re-reading “No Silver Bullets” at least once a year.

I should read Jon Bentley's Programming Pearls, too, but I just haven't gotten to it yet.

Honesty compels me to admit that Knuth's The Art of Computer Programming trilogy is still a little over my head. I've set myself a goal of reading (and understanding) it all by the end of the decade. I have no doubt that it will still be relevant.
Good blogging
Spinsanity has two good pieces - one on debunking some of Al Franken's more inflammatory rhetoric disguised as humour (while acknowledging how well Franken dismantles Ann Coulter's Slander and Sean Hannity's Let Freedom Ring) and the other on GWB's misrepresentation of the effect of his tax cuts on both the deficit and on the economy.

I love the tone and approach. Eminently reasonable, logical, clear, well-argued prose with little or no trace of ideological bias. James Madison would be proud of these guys.

Nema, at Iranian Truth, meditates on the questions she gets about what it means to be Iranian and asks “How do you answer a question you spend your life answering?”. I think she's doing a wonderful job in the series of posts that follow.

101-365, on the delay of the recall: “...at least Davis now knows who that chubby Mexican guy down the hall is”. And scroll down and check out the Full Barley Moon and Mars with the Moon Behind a Tree.

My friend T., in his own inimitable style, has a series of posts on mortality and the afterlife. In between, he's discovered flashmobs, the new baby boom, and how Chinatown one-ups McDonalds.. He also says that because he's drinking less, he's changed the title of his blog back to Crazy, Drunk, and Unemployed. What's up with that, T?

Sunday, September 14, 2003

War and Peace
Molly Ivins, after receiving the usual* hate-mail from the wingnuts on the right after this article:

“Well, I ain't gonna take it anymore. I am not shutting up for Bill O'Reilly or anyone else.

I opposed our unprovoked, unnecessary invasion of Iraq on the grounds that it would be a short, easy war followed by the peace from hell. I predicted that every terrorist in the Middle East would be drawn to Iraq like a magnet.

I was right, and I'm not going to apologize for it.”

You go, girl. Then she adds this:

“I also realize that the future in Iraq is a lot more important than any petty "I was right" vindication...I am trying hard to be a responsible citizen here; I don't think the choice is between "staying the course" or "cut and run." I think we need to change course and be honest enough to admit it to ourselves and everybody else.”

That, unfortunately, is the space (you know, the one between a rock and a hard place) that we find ourselves in. We can't abandon Iraq (or Afghanistan, for that matter) to chaos. Doing so would result in a defeat worse than any military setback we could possibly suffer. But we need to change course and find an effective grand strategy - one that rebuilds and stabilizes Iraq and Afghanistan and that refocuses our efforts on actually fighting the war against terrorism without turning it into a war on Islam.

*(It requires absolutely no imagination at all to figure out what kinds of things were said. That's because your basic right wingnut doesn't have any imagination; all he or she can do is crudely parrot the same tired lines. Your basic left wingnut, on the other hand, suffers from an excess of imagination, which is why they come up with such a wide variety of truly ridiculous notions.)