The Two Things

A lot of people are linking to The Two Things, a fun little page with the premise that for any subject, there are really only two things you need to know…the rest is application.

Charles Miller proposes the two things for computer programming:

1) Every problem can be solved by breaking it up into a series of smaller problems.
2) The computer will always do exactly what you tell it to.

The first is good but the second has a couple problems. One is that it’s too obvious. Another is that while it’s a good assumption to make while debugging, it’s not necessarily true!

There could be a bug in your libraries, which means the computer is doing what the library writers told it to do, but not what you told it to do. There could be a strange loop in your compiler, so it’s doing what Ken Thompson told it to do. If you have multithreaded code on a multicore processor, the computer might try to do what you told it to do, but occasionally fail because the cores get into a fight. (Threading bugs happen with one core too, of course, but not quite so unpredictably.) And as chip features get smaller, the bits get more vulnerable to cosmic rays, so the computer ends up doing something the Universe told it to do.

So here’s my version. Neither is original, but I don’t remember the source of the second one:

1) Every problem can be solved by breaking it up into a series of smaller problems.
2) The thing that compiles your program is just another program.

Pretty much everybody applies the first one, because you can’t get by without it. Not that many people think much about the second, but if you’re not writing microcode it’s the foundation of your work anyway… and if you do apply it consciously, you can get an awful lot of mileage out of it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: