Blog Stats
  • Posts - 102
  • Articles - 32
  • Comments - 206
  • Trackbacks - 16

 

Wednesday, July 11, 2007

Treating the symptoms, but not the problem

A few days ago, I was riding up the elevator to my office and as usual, was annoyed when it stopped at the second floor. My office building has a parking garage right behind it and there's a connection to the second level of the building. I have a parking pass in another garage because there's a two year waiting list for this one, but I digress.

What has often bothered me is the fact that I need to get to the eight floor and more often than not, on my way up in the morning I'm stopped by people who take the elevator from the second floor to the third floor. To get to the elevator on the second floor, you have to walk past the stairs to the third floor. But these people will wait for an elevator so they don't have to climb 13 steps. It's a little ridiculous.

Today, was even more so. The man who got on the elevator had two bags over his shoulders. One was a gym bag that had an old pair of sneakers sticking out of it and some gym clothes next to it. The other bag had some office documents I presume and a Lean Cuisine meal sticking out the top.

This is a classic case of treating the symptoms and not the problem. "I'm overweight so I'm going to go to the gym and get on a diet to lose weight." Nevermind changing the basic habits that made me that way to begin with to solve the problem long term.

I've seen this is software too and it's just as annoying. The following is a recreation of some code I worked on a long time ago.

// Fixed: autocorrect if this variable wasn't set to keep the progg from crashing
if ( selectedOption == null )
{
    selectedOption = 1; // default to the first option
}

Hmmmm. Here's a thought. Instead of just avoiding the problem, why don't you find out what's causing it and fix it!

If the user didn't select something, chances are they didn't mean to select option 1. You can't make the assumption that the user even knew what Option 1 was, let alone that they wanted to select it. Very poor bug fix if you ask me.

When you're debugging a problem, make sure you understand the root cause of it and treat that. Don't assume that by fixing the symptoms, you've fixed the problems. That's like getting treated for lung cancer while you continue to smoke like a chimney.
 

 

Copyright © Mike Taber