"I was hired on to take things over from a fellow named 'Trent', who was known for writing some stunningly awful code," Michael writes, "I was not only to be tasked with rewriting one of our two main software products into a modern language (compared to the VB6 in which it was currently built), but in the short term I was also tasked with maintaining the older versions. "

"Before I started, I tried out our software (consumer utility stuff, registry cleaning, startup items and the like) and found it was crashing on my system. It turned out that the startup items had an issue for Vista users - Trent had hardcoded all of his directories rather than use environment variables, and so Vista systems would attempt to open a folder that simply did not exist.

"By my first day, Trent had, in his last act, finally implemented The Vista Fix, as it was called, in our newer software. And so, a month in, I was asked to duplicate The Vista Fix for the older version as well.

"Poring through the code on the newer and older versions of the function that was crashing, I could not for the life of me find what he changed that made it suddenly work on Vista in the newer function. The folder request was the exact same, in fact both function mirrored one another perfectly. After 10 minutes of staring at the code, I just happened to glance up at the very top when, to my combined frustration, amazement, amusement and disgust (this guy's code was capable of invoking all of these emotions at once), I finally found The Vista Fix:

On Error Resume Next

Michael added, "As much as it pained me to do, I implemented The Vista Fix in the new version, and eagerly moved on to the big rewrite."

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!