We Have Met the Enemy
by Tim Gallagher
in CodeSOD
on 2006-11-14
Today's Code Snippet comes from two different people, Nate and Mike. I felt these were each too small to post by themselves(maybe we'll get to 200 comments?!), so I decided to give a little more. To try a little harder. To reach a little deeper. To, to... Never mind, here's the code.
Nate writes, "Having recently started a new programming job, I've quickly discovered what most of the day-to-day grind entails: Deciphering and cleaning poorly written Visual Basic code before actually being able to perform my assigned work. Our code base has plenty of the usual suspects: Variables with meaningless names like "AA" and "bbb", thousand-line functions (which approach VB's built-in limits), no-ops, unreachable code, gobs of copy-and-pasted code, and a few instances of this little construct (irrelevant code removed):"