Worst ASP Code I've seen...

I don't know what it is lately, but I've just been running into a lot of code that reminds me of the County Land Fill. And that's saying almost being a little too hard on the Land Fill. Let me tell you, that place smells pretty bad. This time, it's a little ASP and some serious abuse of the case statement.

Select Case strApplicant_industry
               Case "1"
                     strApplicant_industry_1 = "SELECTED"
               Case "2"
                     strApplicant_industry_2 = "SELECTED"
               Case "3"
                     strApplicant_industry_3 = "SELECTED"
               Case "4"
                     strApplicant_industry_4 = "SELECTED"
               Case "5"
                     strApplicant_industry_5 = "SELECTED"
               Case "6"
                     strApplicant_industry_6 = "SELECTED"
               Case "7"
                     strApplicant_industry_7 = "SELECTED"
               Case "8"
                     strApplicant_industry_8 = "SELECTED"
               Case "9"
                     strApplicant_industry_9 = "SELECTED"
               Case "10"
                     strApplicant_industry_10 = "SELECTED"
               Case "11"
                     strApplicant_industry_11 = "SELECTED"
               Case "12"
                     strApplicant_industry_12 = "SELECTED"
               Case "13"
                     strApplicant_industry_13 = "SELECTED"
               Case "14"
                     strApplicant_industry_14 = "SELECTED"
               Case "15"
                     strApplicant_industry_15 = "SELECTED"
               Case "16"
                     strApplicant_industry_16 = "SELECTED"
            End Select

I know, it's painful to look at that. So why do I do it? So you know you're not alone in dealing with code that would make a shit sandwich look appetizing. Unfortunately many of us are unable to just scrap this crap and are stuck working with the code. My advice, order this by the case. Anyone want in on a group order?

Related Blog Entries

Comments
Pat S.'s Gravatar I thought this was some of your code!
# Posted By Pat S. | 11/28/07 9:21 AM
Questions or comments? Feel free to email me at kevin.schmidt[at]flexinabox.com