CodeSOD: Code Commenter and Error Handler

This post was originally published on this site

The Daily WTF

Visual Basic for Applications represents the core mistake of putting a full-featured programming environment on every desktop. That so much VBA code is bad is not remarkable- that any good code exists would be shocking.

We rarely cover VBA code, because most of it is written by a non-programmer who discovered they could solve real business problems in Microsoft Access. TRWTF is, in fact, how much of the world runs on an Access database stuffed into a network share somewhere. But there are organizations that hire developers and then shove them into writing VBA, which is what happened to Doug. This code comes from quite awhile ago.

Doug inherited a bunch of VBA code written by another developer. It has… issues. One issue, which Doug didn’t send us, was a 500 switch statement followed by a 700 line switch statement where the vast majority of the clauses were duplicated between

To read the full article click on the 'post' link at the top.