Archive for September, 2009

Better Living Through Happy Code

Posted in programming on September 16th, 2009 by irv – 3 Comments

In my current employment I’m a website programmer. And a technology researcher and system administrator and probably a couple other things. But that’s not important right now. It’s the programming stuff that matters tonight. I have a big deadline coming up in a couple days and I’ve been putting in some extra hours and I’ve had something of an epiphany. It’s probably nothing new to other programmers but it is to me.

We need more comment labels.

It’s like this: Programmer’s make notes in the code we write. They’re called comments. There are certain commonly accepted prefixes that can start a comment – so commonly accepted that certain IDEs (for people who don’t know what that means, think of it as a window you type programs into) recognize them. Some IDEs will apply special highlighting to the labels so they are easy to see. This makes it simple to look at a file and find places where improvements need to be made.

The most common of these labels are TODO and FIXME. Here’s an example from one of my current projects:

#TODO: Move this function to the observer

For the record, I use TODO  a lot more often than FIXME. It would be nice to never use FIXME but sometimes there are other considerations than making every piece of code perfect. Like lunch. Or the demo that’s coming up in 15 minutes and the code had better be working (even if it’s not very pretty).
read more »

The Equation of the Devil

Posted in science on September 6th, 2009 by irv – 1 Comment

I’ve discovered a new science. I’d like to say I founded it or invented it but there are already brilliant people doing interesting work in the field. They just don’t know they share a common field.

To begin, consider this story from Wired about a bizarre scientific paper on the development of a zombie plague. The paper itself (link) is a little dry, though it’s interesting if you can wade through the math. If not, read the Wired story. The basic idea is this: Some mathematicians (with quite a bit of time on their hands, apparently) developed the math to model the spread of a zombie infection. They concluded that, unless humans respond quickly with extremely large amounts of violence, the zombies win, civilization collapses and the human race is ultimately annihilated.

The paper assumes slow zombies, not fast or smart ones. It seems reasonable that both of those situations would make things harder for humanity, most likely. It also assumes that normal human replacement (birth and death) does not take place, since newborns eventually die and the newly dead are a perpetual source of zombies, which means the zombies win. The paper models multiple scenarios, including medical treatment for zombieism and the effect of quarantine procedures on the spread. Factors considered in developing their solutions include rates of transmission, the outcome of encounters (fights) and the effect on the spread of destroying zombies so that they can no longer spread the infection. In other words, despite the seemingly whimsical nature of the subject, this is real science.

read more »