If you're a regular reader, you'll recall Rachel's code submission from last week where we saw super fun things like first and last names represented by double variables. Well, if you enjoyed that, you'll probably love today's CodeSOD.

Rachel wrote, "This method was part of the State class. Apparently if you want to know what index NY is, you need to create a copy of the State class and call it's .get_state_index() method."

private int get_state_index(string state) {
    if(state == "AL")
        return 0;
    if(state == "AK")
        return 1;
    if(state == "AZ")
        return 2;
    if(state == "AR")
        return 3;
    if(state == "CA")
        return 4;
    if(state == "CO")
        return 5;
    if(state == "CT")
        return 6;
    if(state == "DE")
        return 7;
    if(state == "FL")
        return 8;
    if(state == "GA")
        return 9;
    if(state == "HI")
        return 10;
    if(state == "ID")
        return 11;
    if(state == "IL")
        return 12;
    if(state == "IN")
        return 13;
    if(state == "IA")
        return 14;
    if(state == "KS")
        return 15;
    if(state == "KY")
        return 16;
    if(state == "LA")
        return 17;
    if(state == "ME")
        return 18;
    if(state == "MD")
        return 19;
    if(state == "MA")
        return 20;
    if(state == "MI")
        return 21;
    if(state == "MN")
        return 22;
    if(state == "MO")
        return 23;
    if(state == "MT")
        return 24;
    if(state == "NE")
        return 25;
    if(state == "NV")
        return 26;
    if(state == "NH")
        return 27;
    if(state == "NJ")
        return 28;
    if(state == "NM")
        return 29;
    if(state == "NY")
        return 30;
    if(state == "NC")
        return 31;
    if(state == "ND")
        return 32;
    if(state == "OH")
        return 33;
    if(state == "OK")
        return 34;
    if(state == "OR")
        return 35;
    if(state == "PA")
        return 36;
    if(state == "RI")
        return 37;
    if(state == "SC")
        return 38;
    if(state == "SD")
        return 39;
    if(state == "TN")
        return 40;
    if(state == "TX")
        return 41;
    if(state == "UT")
        return 42;
    if(state == "VT")
        return 43;
    if(state == "VA")
        return 44;
    if(state == "WA")
        return 45;
    if(state == "WV")
        return 46;
    if(state == "WI")
        return 47;
    if(state == "WY")
        return 48;
    if(state == "MS")
        return 49;
    if(state == "PR")
        return 50;
            
    return 51;
}

I looked through the list and every state is represented - including Puerto Rico, though it's not technically a state, and that's fine (sorry Guam, USVI, et al., we love you anyway) - but why is Mississippi (MS) floating out of order at the bottom of the list? My bet is that the programmer decided to recall a list of states from memory and got 49 out of 50 until someone noticed. If this were a high school geography class, he'd earn an "A". Instead, here in the real world, all he earns is a "WTF".

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