Version Check again and again
Developers care about job security. They have to. In my conspiracy theories, the Y2K bug was an evil plan by a group of developers that saw their 401k's take a nose dive and they wanted a backup plan for retirement. Without too much investment, that is.
I came across the version check issue again today. A complicated application with multiple instances launching themselves, talking to services, creating events etc. error-ed out with a let's say, non-descriptive error message. Considering the architecture I was expecting either UAC, MIC or Session 0 isolation as the culprit. But no. After an hour of two debugging (my, how much easier is user mode debugging than kernel mode), the culprit was (in pseudocode and simplified):
dwVersion = GetVersion();
if ( dwVersion == 5 )
name = "this";
if ( dwVersion == 4 )
name = "that";
And that was it. No 6. No 5 and up.
By the way, check the notes in GetVersionEx(). It is not always the best approach to check the version, checking for availability of a feature might be more desirable. Reason is that features might be added (or removed). But then again, for job security…
Comments
Anonymous
January 31, 2008
>Developers care about job security. They have to. Unfortunately, Job Security is an illusion at best, 'cause there ain't no such thing. You can find a hint of what real security looks like in "The Pragmatic Programmer" by Hunt & Thomas (1999), pp 14-15 Did you mean to type (double-equals): name == "that";Anonymous
February 01, 2008
Thanks Subterrain. Made an update to the pseudocode. I was cynical with the job security. I was joking that developers' actions lead you to believe they are securing their job.