Menu:

Who are you calling Scruffy-looking?

July 16, 2007

I generally wait far too long in between hair cuts. Right now I'm at least a month over due. My bangs come down past my nose if i pull them forward and i can almost cover my ears. On top of that, Thomas was fussy this morning and I didn't get much sleep. As usual when I wake up exhausted, I stayed in the shower too long and didn't have time to shave. So, I'm definitely sitting on the scruffy side of the fence this morning.

In other news, I've been completely sold on the idea of unit-testing in software development. The idea is that you write tests for each self-contained module in your program before you write the module. Then, once you feel like all the tests are in place, you write code until you pass all the tests. There are a number of benefits to this approach. My favorite is that it gives me the confidence to radically rewrite code. As long as it continues to pass the tests, then all is fine with the world. Normally, I'm afraid to touch blocks of code, especially if I didn't write it, since I know I'll have to spent a lot of time making sure it still works the way it was supposed to. Another great thing is that it gives you a goal to shoot for. You always know when you are done, because all the tests work.

You might think that writing a bunch of tests is boring, but it is actually a challenge to find ways to test certain things. For example, you want all your tests to run fast, but that means code that depends on timers will have to be abstracted away from the "real time." Similarly, graphical code can be tricky to write tests for. Writing unit tests also means that I solidify my interface in advance and it makes me think more about how I intend to use the code in practice.

I've recently been reading Lord of the World, by Robert Benson. It is a science fiction novel written in 1906 about the end of the world. The author was a priest, so it features the triumph of Catholicism over the threat of modernism under dire circumstances. It is sort of like a Catholic version of the "Left Behind" series. I find it interesting from a certain perspective, but I'm not too happy about the dichotomy between science and humanity on the one hand, and Christianity on the other. It seems that Benson couldn't conceive of a world where science and faith co-operate or where Catholic Theology could make use of modern and post-modern ideas. I think it says a lot about the mindset of people before the horrors of WWI, WWII, the Holocaust, the Cold War, Vietnam, Stalin, and so on. The 20th century was a traumatic one for humans. We're still trying to deal with the results.