16 November 2005

U.S. history fact of the day

Back in the 1790s, it was apparently taken for granted that the U.S. government was a secular institution. I didn't know this. But it's declared, in the clearest possible language, in a treaty read aloud on the floor of the Senate and signed by President John Adams.

11 November 2005

Debt vs. GDP endgame

Why do we even care about the national debt?

Here are four long-term scenarios concerning the debt.

  1. We pay it off. This means some suffering, because it won't be cheap. We owe eight trillion dollars. The reward would be that we wouldn't be paying interest on the debt anymore. (There might be an economic reward, as well as the financial one; but I don't know.)

  2. We maintain it roughly at steady state, relative to inflation. This means we'd have to stop borrowing to cover the costs of present-day government programs. Assuming the U.S. economy continues to grow (an extremely safe assumption), this means the debt eventually becomes quite easy to pay off. At some point in the future, eight trillion Frosties will be chump change.

  3. We maintain it roughly at steady state, relative to GDP. This means paying more and more interest every year; but as long as GDP is growing, we're richer and richer every year, so we don't really feel it. Ever. Economists' comfort level would remain roughly level as the debt grows.

  4. We eventually default on the debt. That is, it eventually gets so out of control that we can't roll it over; not enough people will buy our T-bills anymore. Or we make a political decision to bail. From what I hear, this is an extremely bad scenario for the economy.

    Now the nature of debt is that by the time you start to feel the crunch, it's too late. All kinds of economic mayhem will happen before we reach the point of default: interest rates will rise, investment and growth will stall—but these little disasters will not stave off default. By worsening the economy and killing tax revenue, they'll probably accelerate us toward it.

I'm no genius, but it seems like a path somewhere between #1 and #2 might be a good idea. The path we're on right now falls somewhere between #3 and #4.

A coffee snob speaks

I have to say, when McDonald's decides to do a little marketing, they really do it. In New England, they're carpet-promoting their new, politically correct, organic, gourmet, $1.29-for-a-small-cup coffee. For two weeks, they're giving it away to anyone who'll take it. But what sealed the deal with me is that they're getting the coffee from Green Mountain.

So I tried some. It's kind of amazing. It's as though they were afraid that actually selling good coffee would turn off loyal McDonald's-coffee drinkers. The new custom blend is like a gourmet version of the bitter, acrid coffee they sold before. It's an achievement of some sort, in that I wouldn't have thought it possible. Blechh.

10 November 2005

Time and deficit spending

In the software business, time is precious.

Software engineering teams often borrow time from the future at a very steep interest rate. Two examples:

  1. A team is hurrying toward a deadline. The team has painstakingly produced a detailed design document for the product. To save time on the current release, the team stops updating the document as changes are made. The plan is to bring it back up to date after the deadline.

  2. A company has a product for Windows. The company needs to ship the same product for Mac OS X. One plan would be to rework the Windows codebase to make it platform-neutral. Instead, the team chooses an alternate plan. They branch the two codebases. This allows feature development and releases to continue at speed on the Windows branch, while the new branch works on OS X support. Both projects will reach near-term milestones sooner. The long-term plan is to merge the two codebases, a time-consuming task.

In each of these cases, the team gets extra time now, at the expense of time later. In each case, they must either spend the time later to clean up the mess; or lose a lot of work.

I suspect the interest rate on these loans is high (200%-ish), but then the expected ROI for time (as opposed to cash) can be very high as well.

How should these decisions be made?

09 November 2005

Programming language feature request: Point comments

Programming languages still don't have all the features I want. Here's an example.

I want point comments, special comments that briefly explain the point of the following block of code. The language would guarantee that whenever an exception falls out of a point-commented block of code, the point comment is automatically added to the resulting error message.

Here's some pseudocode that shows what I'm talking about. The characters //- denote a point comment.

 //- set up the flogmogger to do ${job}
 if baz
     flogmog.setup()
 else
     flogmog.reattach(baz)

 //- forward the request to the remote agent on ${flogmog.host}
 env = new Rpc.Envelope
 env.stuff()
 reply = flogmog.send(env)
 reply.validate()
 logger.logRpcResponse(reply)

Here's how this would work. At the point where the comment appears, the system evaluates any variables that appear in the comment (in this case, ${job} in the first comment and ${flogmog.host} in the second). It stores the values on the stack and proceeds. If the chunk of code under that comment fails with an exception, the exception is automatically caught; annotated with the comment, including the pre-calculated value of any variables that appear in it; and rethrown. These annotations could be stored in a field of the exception object.

Then, whenever an exception object is called upon to create a user-visible error message, it includes these annotations to tell what the code was trying to do at the time of the error. Here's a sample error message:

    Failed to forward the request to the remote agent on localhost:
    RpcException: URI not found (/inventory/donuts).

Of course, if the caller had its own point comments, and the RPC module had its own point comments, you would get something more like this:

    Failed to order more donuts from Xylonium Nuclear Bakery:
    Failed to forward the request to the remote agent on localhost:
    Failed to confirm RPC transaction was successful:
    RpcException: URI not found (/inventory/donuts).

It's like a traceback--but instead of source code files and line numbers, you get meaningful English messages. I think both are valuable for programmers, and improved error messages are always welcome from the user's perspective.

A mechanism for achieving this level of error-message coolness exists in some languages: exception chaining. But really using it requires a lot of boilerplate try/catch/throw.

Another flavor of point comment should be provided to allow for internationalization. I had something like this in mind:

 //= flogMogSetup(job)
 ...

 //= forwardRequestTo(flogmog.host)
 ...

The actual error messages for each language would appear in separate message files, of course. Here flogmogSetup and forwardRequestTo are just keys into the localized message files.

Comments that actually do stuff are something rather, er, different; but pragmatism beats purity. If necessary, the syntax could be changed to look less like a comment and more like code.

A more significant critique is that these error messages still wouldn't be very good. I consider point comments another weapon against bad error messages. Maybe the ultimate answer is for programmers to spend thousands of hours really polishing the error messages their systems generate. I just don't think that's realistically going to happen. I think point comments would improve the baseline case. It's worth a shot.

05 November 2005

J. turns 2

This is J. He's my son, as you can tell; he looks just like me.

(J. behind a book photo)

J.'s grammy bought him a table for his birthday and came up for the party. (That's J. on the right.)

(J. and Grammy photo)

There were a few balloons at the party. One of them was a very large two, or as J. says, “five”.

(J. with ‘2’ balloon

D. & M. gave J. this very cool cardboard box. It was even more fun after we got the green Winnie-the-Pooh chair out of it.

(boys in a box photo)

J. wasn't the only one to get presents for his birthday. O. and I got some Legos. Here's O. putting the finishing touches on an ostrich.

(lego ostrich photo)

We were previously unaware that all you have to do to get Legos is raise a screaming baby to age two. This is an important revelation. Sign us up for another!

03 November 2005

What does this mean?

(chart of U.S. national debt divided by GDP, 1950 to present) Disclaimer - I threw these numbers together myself in Excel from data from two seperate sources. I don't know what I'm doing. If you use this graph for anything serious, you're insane.

Next in line: Iran

The White House is now talking about how military action against Iran is “a last resort”, which I think means the decision has already been made.

I opposed invading Iraq. I'm not sure about Iran. There are a lot of differences. To start with:

  • Iran really is seeking to build nuclear weapons and has already acquired the nuclear material to do so.
  • Iran's government really is a theocratic regime with ties to Islamist terrorists.
  • Iran might be a lot tougher militarily—it's bigger and in better economic shape.
  • If we invade Iran, we have to worry about Iraq disintegrating.
  • We won't have any allies this time. Britain has already publicly and repeatedly opted out.

So: harder, but more justified. The doctrine of preemption certainly would seem to require war. Does anyone see the case for war in Iran as seriously weaker than the case for war in Iraq?

Last night I finished watching the first season of Veronica Mars. Great stuff.

It's a teen girl detective show with amazingly dense plotting. You get a mystery every week, and developments in one or two multi-episode plotlines, and a new twist in the season-long super-mystery. I don't know how they find the time to cram in all this information, but it's expertly done. Solid dialogue, good world design, very good characters, good acting (mostly). Teen angst and romances are part of the bargain, but it's not overdone much.

TV shows are a lot more complex than they used to be.

Reading friends' blogs is risky. I'm worried about spoilers. They're watching the second season on TV now, and I won't see it until it comes out on DVD.

Netflix is great for watching shows like this.