Bull’s Laws: The Single-Character Rule

A quick introduction to this category of posts before I get to the meat of the issue. Over the years during which I’ve made my living writing computer code, I’ve uncovered, discovered, created or outright stolen several aphorisms about writing good code. In keeping with the arrogance that comes with being a computer programmer, I gave them the grandiose name Bull’s Laws of Software Development. Most of them aren’t really laws, just personal guidelines or humorous little sayings. Please do not cite them in a court of law. That would not go well for you.

One more quick note. I don’t know exactly how many laws there are, and every time I reference a law, I arbitrarily assign it a new number. (Please see my forthcoming* post on the impact of arbitrary numbering schemes on the efficacy of humor.)

Okay, enough dilly-dallying. Let’s get on to Bull’s Law of Software Development #37: The Single-Character Rule.

Put simply it goes like this: The longer you spend unsuccessfully attempting to fix a bug (or issue or what have you) in your code, the greater the chance that it’s caused by a single errant character.

I cannot tell you how many times I’ve been bitten by this. (Not because I don’t know the number but because thinking of the number makes me want to cry.) Semicolons in particular have wasted many hours of my life. A single missing curly brace can turn a finely-tuned piece of code into a steaming mess of compiler errors faster than a horde of programmers can demolish a pizza buffet.

I know some people will think this is blindingly obvious, along the lines of “it’s always the last place you look”, but this is the first Law I ever came up with, and still the one that comes up the most often. And I have occasionally found it to be a useful reminder. When I’ve been staring at the same code for an hour and can’t figure out what’s wrong, I think of this rule. It prompts me to take a break, walk away from the problem for a few minutes, and then come back to look at it from a fresh angle, thinking mostly of where that one character is (or isn’t). More often than not, I can spot the problem right away.

If any non-programmer type person has made it this far into this post, hopefully there’s a little nugget of wisdom that can be applied to other problems. Aaaawwww, who am I kidding, it’s just us nerds down here. Might as well indulge in some real nerd speak, then.

Can you believe the specs on the new Ramostat Quadthruster? Like anyone really needs a six-core multiprocessor on a Quadthrusting hyper-flangle. Am I right, nerds?

Nerds?

Man, now it’s just me.

(sigh)

* And by “forthcoming” I mean I will never write such a post.

Aunt Peggye Does the Hula

Last week I was in Boston for my great aunt Peggye’s 100th birthday. (Peggye is my maternal grandmother’s sister, and yes it’s spelled right. She added the terminal ‘e’ when she was fifteen and she insists that it be spelled that way.) She’s in incredible shape for her age, and still amazingly sharp mentally.

At one point during the day I was trying to explain to Aunt Peggye what I do for a living. She understands that  computers exist but knows basically nothing about how they work and has zero understanding of email. My attempts to explain led he to talk about her days in a secretarial pool and her manual typewriter. She retired at age 65 in 1977 (when I was five) and never used a computer in her life.

Her expectations for a relaxing retirement were crushed when her husband suffered a massive stroke about two years later. He never walked again and spent the next twelve years in a nursing home. Aunt Peggye never learned to drive, so she took a bus to see him every day. When Uncle Fred finally passed away, she told me she “got real active again”.

She joined a singing group (with her church I think) and went to nursing homes and the like to entertain. This while at the young age of 77. She told me that once they sang at a convent for a group of nuns.

What follows is (as nearly as I can remember it) what she said next:

After we sang, this little nun came up to talk to me. She was young and just cute as a button and shorter than me if you can believe it. (Aunt Peggye is five feet tall, if that.) She said she liked the way I rolled my eyes during one of the songs. I said that I would normally roll my hips but I didn’t feel right. There was a big crucifix, life-size. Six feet tall. As tall as you. How tall are you? Six feet. I said I didn’t feel right in front of the crucifix to move my hips. (Here Aunt Peggye shifted her hips back in forth in her chair in what I can only describe as the cutest imitation of a hula dancer I’ve ever seen.)

And the nun said to me “I think he would like it.”

I haven’t laughed so hard in a long time.