Friday, April 25, 2008

I have The Moose


In programming circles, it is common to keep a small stuffed animal to be kept by whatever team member has done something gloriously stupid. Some places use a Big Mouth Billy Bass, but most of my friends use a moose. Whenever one of us screws something up big time, we request possession of The Moose.


Today I took a double possession. The first incident involved a boolean function. Here is more or less a breakdown of what I did:



[20:40] <VP|bofh> function returns true/false



[20:40] <VP|bofh> function uses sproc to return true/false



[20:40] <VP|bofh> sproc uses a record count to decide true/false



[20:40] <VP|bofh> zero records = true



[20:40] <VP|bofh> > zero = false



[20:40] <VP|bofh> the ACTUAL function returned zero records = false



[20:40] <VP|bofh> > 0 records = true



This basically means that my true/false function was returning false/true instead. This ate two hours of work last night, and another hour this evening.


The second incident was subtle. I had a sequence of events:


1. Check authentication status


2. Check secondary authentication status


3. Execute a function


4. Execute another function


5. Execute another function


6. Auto-login


And it wasn't working. Since I was still reeling from the boolean error, I started adding breaking points and checking every line of code. One hour into it, I found the culprit: when I copied the function I needed to use for step #4, it had a built-in self-authentication check, which made sure only logged-in users could run the function. This meant that even after I had checked the two authentication methods, I had a rogue third check within my code that was raising all sorts of hell.


So now I have The Moose.


Photo Credit: Photo by grizzbass, used under the terms of a Creative Commons license.



0 comments: