Archive for March, 2008

Lazy Decision Making

We recently cleaned out my parents’ garage so that it could be torn down to make room for an intergalactic expressway a storm drain. Amongst the millions of childhood memorabilia was this book, which was the first taste I got of computer programming.

It taught us Apple BASIC, and we used it to program our Apple IIc that had one external drive. We had a bunch of floppies, a few of which we loaded ProDOS onto and toiled away.

If I recall correctly, my older brother was the one who had actually purchased the book (or convinced my parents to buy it for him) so it was ostensibly his, and he assuredly read through the thing quicker than I did, and understood more of it that I did even when I had read most of it. I was, after all, 8 at the time.

But with that book and that computer we set about to write our own games. I still believe that every programmer of my generation gets into computers for the games. I wrote a little game where you could run through computer systems a la Shadowrun, breaking ICE and finding valuable files. I tried to do HiRes graphics, which was why the game never got finished.

This was before I understood anything about design. Not that you could design in BASIC, but still.

What I did was try to figure out everything I would ever need to do, I wrote it down in a big list, and then I started at the top of the list. I wrote the main screen. I wrote the login. I wrote the first bit of navigation into the fake computer system. I got overwhelmed and never returned.

I was following what is now called the Waterfall model, where you spend a whole lot of time figuring out what you’re going to do, and then you write it all down in excruciating detail and make sure that it covers everything, then you check again. Then you check again and start programming.

This model was invented when you programmed with punch cards and had to make sure that everything worked reasonably well the first time. If it didn’t, you’d have to change something, and changing things was nigh impossible, because you can’t just insert a new row on the punch card: it’s cardboard. So you do proofs and flowcharts and loop invariants and whatnot, trying to make sure that when you go to the trouble of making the punch cards, everything works out.

Contrast that with what most programmers do today, which is sometimes referred to as Extreme Programming, XP, Agile Development, or simply Iterative Development. Whatever you call it, you figure out only what the next step is and you program that. Then you test it. Ideally, you write a test for it so that the test can be run by an automated process. Then you move on to the next step.

Developers like this method because they get immediate results (and they do a lot less paperwork). Managers like it because they get lots of feedback (and they do lots less paperwork). Customers like it because it allows the developers to respond to feedback, which means the customer gets something he actually wants, instead of something he kind of wants.

Iterative Developement is part of a larger trend in the computing world toward deciding things later, because later you will have more information with which to make the decision. It’s called Lazy because you make the decision only when you need to, as opposed to Eager decision making, when you make a decision when you think of the question.

Static typing is eager decision making. You have to decide everything up front when you don’t know enough information, and if you change it later, you’re screwed.

This is one of the reasons why the trend in computing is toward dynamically typed languages, and away from static typing. It allows you to make decisions later (at runtime), when you have more information. That allows you to be freer in your programming because you’re not making decisions based on guesswork. But most of all, it allows you to skip an entire step of development (laying out a class hierarchy) that will inevitably cause you pain in the long run when class A doesn’t inherit from class B, and neither implements interface C. This step becomes a much looser and more manageable hurdle when you can just make sure that the right methods are there, or better yet just mix in a module you already have.

The obvious next question is: what other decisions are we making too early? I wouldn’t be surprised if there are some huge ones out there. Paul Graham is fond of pointing out that the startups he funds often create a completely different product than they set out to create, and that seems like a pretty large decision to make lazily.

Scenes from Chipotle

[Two men, each about 50, sit at a table over burritos. One of them is wearing a t-shirt that says "If you don't like abortions, don't get one." He is listening as the other man speaks]

Man #1: But the planes couldn’t have brought down the towers. The physics don’t work. And the Democrats are in on it. Howard Dean is not a dumb man; he’s inquisitive. He’d figure it out.

[Man #2 is not buying it. He's too smart for that.]

Man #2: But what about Castro? Who told him to be quiet? Bush and Castro have the same master.

I really, truly wish that I were making this up.

Music Pricing

Apple put out a press release last week saying that iTunes is now the number two music retailer in the US, behind only Wal-Mart. Wal-Mart, for it’s part, is making rublings:

Wal-Mart stirs CD pricing pot with multi-tiered plan - Yahoo! News:

Wal-Mart… has proposed a five-tiered pricing scheme that would allow the discounter to sell albums at even lower prices and require the labels to bear more of the costs.

(Via Andrew Sullivan.)

Wal-Mart has seen Apple beat retailer after retailer on this, and sees the writing on the wall: buying online is cheaper and faster, so there’s no reason to buy from a store. If they want to keep sellng music, they need to change the rules. And that’s what they’re proposing.

But, as the article makes clear, that’s only if they want to keep selling music, and that’s not necessarily true:

One label executive said, “This sounds like the Hail Mary pass, and if it doesn’t work, they could be out of the music business; or maybe they reduce music down to a couple of racks” from the 4,000 titles carried by Wal-Marts with larger selections.

That’s a huge play for Wal-Mart, and it sounds eminently reasonable from Wal-Mart’s perspective. Basically, the Labels have given Apple the sweet deal (cheaper prices) that Wal-Mart is used to getting, and because Wal-Mart is all about cheaper prices, they’re not able to compete. And if they can’t, then they’re willing to cut off the non-competitive part of the business. Wal-Mart is nothing if not ruthless.

Note, though, that there’s a giant gap between “non-competitive” and “not profitable,” and therein lies the interesting part. As long as Wal-Mart is making money selling music, why would they care if Apple is making more money selling music? Unless Wal-Mart is just feeling stilted about not being given the best price, it has to mean that they don’t think they can fend off Apple given the current pricing scheme. And seeing as how Wal-Mart’s online music store did have the lowest price when they were still in business, I have to guess that it’s the later.

All told, it’s great news for Apple. Wal-Mart is in a reactionary position, but if Wal-Mart wins against the labels and holds onto the number one slot, Apple can argue that lower pricing is better for sales and demand it themselves. If new pricing doesn’t keep Wal-Mart up top, it’s Apple who takes the crown. On the other hand, if Wal-Mart doesn’t get better deals and does cut their music shelf space, Apple catapults into first place, and again has more leverage.

And of course, this is really bad news for the labels, who are going to have to choose to lower their margins or lose a chunk of business, or both. Couldn’t have happened to a nicer group of guys.