Made of Everything You're Not

No, not the flute playing Eric Lamb; the guitar playing, PHP programmer Eric Lamb. The better Eric Lamb.
  • Home
  • Projects
  • Portfolio
  • Resume
« Goodbye StreetWise; It Was Fun
A Computer Shouldn’t Have Flair »

Don’t Just Jump In and Code. Ever

Obvious statement; programmers are, at their core, are problem solvers. Yes, our output is code, but at the base level the entire process of creating the code is in response to some sort of problem. On top of that, once the initial problem is solved we’re still responsible for fixing new, unknown, issues when they come up.

Problem Solving Flowchart

Problem Solving Flowchart

Solving problems is what we do. I was reminded of this the other day when a bug was logged about a project I’m working on.

The issue was that the tab ordering on a form, where you use the tab key to move between fields in a form, was skipping the select fields in FireFox on a MAC. Since I wrote the program the issue was reported in so the responsibility for fixing it fell to me.

Now, how would you solve the issue?

Assuming you took exactly the same path I did, you would probably attempt to replicate the issue and found that, yes indeed, when tabbing between fields in a form the order for the tabs was unreliable; it would skip all the select boxes. Seeing the proof, you might start looking into what could be causing it.

Immediately, all sorts of suspects come to mind:

  1. The field “label” elements could be wrong.
  2. The divs the fields are placed in are out of order
  3. FireFox could just be broken (hey, it does happen)

As do a couple “simple” solutions that remove the issue without technically fixing the problem:

  1. Set a dedicated “tabindex-n” in each field element. This could force the tab flow but it’s not known if it will fix the issue .
  2. Write FireFox specific JavaScript to force the tab order in that browser (costly but certain to fix)

You now sit at a crossroads of sorts; you can figure out why tabbing isn’t working by eliminating suspects or you can attempt to bypass the issue entirely and use  one of the above “simple” solutions or you take door number #3 and do more research on the issue before making a decision on direction.

We’ve seen it time and time again; programmers eager to just jump in an start changing things, writing things, and just creating things. This is always, 100% of the time, no excuses, unequivocally the wrong move.

Doing, just basic, research on the issue produced this gem from CoolWeblog:

I just spent the better part of an hour trying to get tabindex to work under Firefox/Mac OS X.

The solution lies not in Firefox, but in the Mac OS X preferences.

Apple Menu > System Preferences > Keyboard and Mouse > Keyboard Shortcuts

and under “Full Keyboard Access” choose “All controls”.

Sweet lord….

Attempting any of the above solutions would have been a HUGE waste of time; essentially just grasping for straws.

Bookmark and Share

This entry was written by Eric Lamb and posted on Thursday, July 23rd, 2009 at 5:00 am and is filed under Brain Dump, Programming, Rant. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Comment

  1. Gaby says:
    July 23, 2009 at 9:50 am

    Having to solve problems in code I was responsible for writing is one of my biggest fears. I’m sure I’ll get used to it once I’m coding in the real world, but as it is we don’t really get much experience with that at uni.

    You provide a really good example here of why jumping in and coding right away isn’t the best thing. I find even with non-coding problems a quick search can provide a solution that is quicker than anything else I had planned to try.

    Reply

Leave a Reply

Click here to cancel reply.

  • Subscribe: Entries | Comments
  • About Me

    Email Email
    Twitter Twitter
    310.739.3322
  • Categories

    • Brain Dump
    • Business
    • Code
    • IT
    • Programming
    • Rant
    • Servers
  • Archives

    • October 2011
    • August 2011
    • July 2011
    • June 2011
    • May 2011
    • April 2011
    • March 2011
    • February 2011
    • January 2011
    • December 2010
    • November 2010
    • October 2010
    • September 2010
    • August 2010
    • July 2010
    • June 2010
    • May 2010
    • April 2010
    • March 2010
    • February 2010
    • January 2010
    • December 2009
    • November 2009
    • October 2009
    • September 2009
    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008

Copyright © 2008 - 2012 Eric Lamb - All rights reserved