Tuesday, September 9, 2008

OT: If only there had been some clue

Hardly a week goes by without seeing a question that starts with "My query is not returning the right results..." and ends with ".. Oh yeah, and the values in the ColumnXYZ are a list like 1,5,6,18,97. So can anyone tell me why my query does not work?".

{Sigh} The question inevitably elicits a slew of responses about proper database modeling and normalization. Followed by a predictable set of responses from the OP. In confusion they ask "what do you mean by junction table?" Then in disbelief: "how can creating more tables and more records be better?".

You know ... it is almost as if they think you are trying to trick them. As if the fact that they already spent the better part of two hours, working on a single a query, was not clue enough that maybe .. just maybe.. they were headed down the wrong path.

Usually after a few well worded explanations, most are ready to be "saved" and embark on the higher path to database enlightenment. I am a convert myself. But occasionally you run across a true die-hard disbeliever. They scoff at the mere idea of database modeling. Standing unrepentant (and unfortunately .. very vocal) in their ignorance. I suspect they have business cards and t-shirts emblazoned with their name and title:


      John Smith, CEO
      Ignorance Incorporated
      - "Fighting knowledge since 1975"

We all go through periods of ignorance. I am certainly no exception. But it should be a transitory state. Not fervently embraced as a way of life. But for those resolute souls out there, proudly donning their t-shirts and handing out business cards, I can only respond with this bit of absurdity:

Why does your query not work? Because you have angered the database gods. They are powerful, capricious and vengeful. Unfortunately you are now the object of their wrath. They have forever cursed you in punishment for your poor and unworthy database offering. You will spend eternity in database hell, designing increasingly complex queries only a contortionist could admire. Queries that will execute at an agonizingly slow pace. Some will run eternally, never returning results. While others will occasionally drop records or include seemingly unrelated records for no reason you can detect.

Abandon hope. You are doomed. When you reach the gates of database hell, think twice before offering explanations like "my boss prefers it this way" or "changing it was too complicated". The gatekeepers have already heard those cries from other unfortunate residents. Repeating such excuses will only enrage them further.

As you are sitting in your cell, writing queries of infinite complexity, think back to the two hours you spent struggling with that first query. That was the harbinger of this moment.

4 comments:

Joel September 10, 2008 at 2:38 PM  

How true it is.

You illustrate a major difference between good and bad developers. A good developer may not know everything, but is willing to be proven wrong. A bad developer pretends to know more he does, and is unwilling to ever be wrong.

cfSearching September 16, 2008 at 7:33 PM  

Yes, all humorous ranting aside .. I do not think most people like being wrong. I guess the difference is some people are just willing to waste a lot of time and energy railing against that unavoidable truth.

But why wish for perfection anyway? If you were omniscient, life would be no fun at all ;-)

Anonymous,  October 6, 2008 at 3:17 AM  

I find that the answer to the question, Why isn't my sql (or program for that matter) not working?" is because the computer has this annoying habit of doing exactly what I tell it to do instead of what I want it to do.

cfSearching October 6, 2008 at 12:11 PM  

@Anonymous

Well if you are going to resort to logic ... ;)

  © Blogger templates The Professional Template by Ourblogtemplates.com 2008

Header image adapted from atomicjeep