• (cs)

    The American educational system at its finest!

  • (cs) in reply to res2

    NEW YORK
    NEVADA
    NEW HAMPSHIRE
    NEW MEXICO...
    They're all Nebraska, you know?

    Not to mention Maine becomes MA....

  • (cs)

    One of those WTFs that you just shake your head at.

    I guess it wouldn't be any use to ask him to name state capitols, eh?

  • (cs)

    Ahh... a nice, classic, good, old-fashioned WTF.  You made my day :)  So bad on so many levels... like doing ToUpper BEFORE substringing it, all the way to "optimizing" for any states that are only two letters long.

  • Effendi (unregistered)

    This has to be my favorite WTF yet!

  • (cs)

    Michigan
    Minnesota
    Mississippi
    Missouri

    ....

  • (cs)

    <FONT face="Arial Unicode MS">Wow....not much to say about this one other than WTF?!?[:|]<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT>

    <FONT face="Arial Unicode MS">State codes are pretty common knowledge, and this guy chose to ignore it...."Hmmm... instead of having to read the state codes from a database I'll just get the first two characters of the state's name. What could go wrong? Brilliant!"</FONT>

  • (cs) in reply to skicow
    skicow:

    <font face="Arial Unicode MS">Wow....not much to say about this one other than WTF?!?[:|]<o:p></o:p></font>

    <font face="Arial Unicode MS">State codes are pretty common knowledge, and this guy chose to ignore it...."Hmmm... instead of having to read the state codes from a database I'll just get the first two characters of the state's name. What could go wrong? Brilliant!"</font>



    Must be an optimization... why hit the database when you can just make up abbreviations?
  • (cs) in reply to Charles Nadolski

    Charles Nadolski:
    ...all the way to "optimizing" for any states that are only two letters long.

    LOL! I totally missed that part - I was blinded by the sheer stupidity of the rest of the code.

  • (cs) in reply to Charles Nadolski

    My guess is that this was an H-1B visa programmer or foreign contract (no Visa, it was written in Bangalore) who may have glanced at the list quickly and has no clue as to U.S. geography.

  • Ross Presser (unregistered) in reply to mizhi

    <font size="2">This ties in with my other "favorite" (actually very aggravating) WTF ... typified by this email I sent to Yahoo Movies a few years ago:</font>
    <font size="-1">
    </font>

    <font size="-1">Name: Ross Presser</font>

    <font size="-1">Subject: Possible Bug</font>

    <font size="-1">Type your feedback here:</font>
    <font size="-1"> When I clicked on showtimes for a movie </font>
    <font size="-1">and it retrieved my zip code (from a </font>
    <font size="-1">cookie, from a profile, whatever) which </font>
    <font size="-1">is 08030, it reported that there were </font>
    <font size="-1">no showtimes in my area, and had the 4-</font>
    <font size="-1">digit "8030" in the "enter your zip </font>
    <font size="-1">code" field. The code probably calls </font>
    <font size="-1">it an integer and doesn't check for 5 </font>
    <font size="-1">digits. Remember, California </font>
    <font size="-1">programmers, that several states on the </font>
    <font size="-1">East coast - NJ, MA, RI, and a few </font>
    <font size="-1">more -- have zip codes that start in </font>
    <font size="-1">zero.</font>

    <font size="-1">While Viewing: http://help.yahoo.com/help/movies/</font>
    <font size="-1">
    <font size="2">I also have a receipt from homestarrunner.com with the same problem:</font>

    </font>
    <font size="-1">Thank for ordering from the Homestar Store. Your order has been accepted. You will receive a shipping confirmation when your order has been shipped.</font>



    <font size="-1">Your Order Number is HR45223</font>

    <font size="-1">The following Items:</font>

    <font size="-1"> *** Ordered ***</font>
    <font size="-1"> 1 2020 Trogdor Bumper Stickers (Pk of 2)</font>
    <font size="-1"> 1 0166 Trogdor Shirt - Double Extra Large</font>

    <font size="-1">Will be Shipped To:</font>
    <font size="-1"> Ross Presser</font>
    <font size="-1">xxxxxxxxxxxxxx</font>
    <font size="-1"> Gloucester City, NJ 8030</font>
    <font size="-1"> United States</font>
  • (cs)

    <font size="2">Well, the function is GetStateAbbreviation, not GetCorrectStateAbbreviation...</font>

  • Matt B (unregistered) in reply to Charles Nadolski
    Charles Nadolski:
    Ahh... a nice, classic, good, old-fashioned WTF.  You made my day :)


    Agreed, there's no usual forum-justifying this one :)    +
  • (cs)

    <font size="2">hmm...doesn't check for actual existing states either.
    GetStateAbbreviation("fun stuff") == "FU"
    GetStateAbbreviation("x") == "X"</font>


  • (cs) in reply to John Smallberries

    John Smallberries:
    <FONT size=2>Well, the function is GetStateAbbreviation, not GetCorrectStateAbbreviation...</FONT>

    Heh.

    Public String MakeUpYourOwnStateAbbreviation{}

    Guaranteed to be accurate 38% of the time!

     

  • (cs) in reply to BradC

    I wish I was this coder's manager... I'd send him a three-line review:

    GetStateAbbreviation("NORTH CAROLINA")
    GetStateAbbreviation("NORTH DAKOTA")
    GetStateAbbreviation("NORTHERN MARIANA ISLANDS")

  • Lenny (unregistered)

    This is why we do not have to worry about offshore outsourcing. 

  • Daniel T (unregistered) in reply to Maurits

    I really hope they stored something like a Zip Code in there as well otherwise they have a LOT of bad data...

  • Anonymous (unregistered)

    I was wondering how they were getting state names from state abbreviations (to explain why all the orders were assigned to Nebraska)

  • Fregas (unregistered)

    I think butthead said it best:

    "uh..huh, huh....you....DUMBASS.....!"

  • (cs)

    The biggest WTF in that code is that it doesn't accommodate those states with several words in their name, like New York (NY) or Western Tennessean Florida.

  • (cs)

    I'm guessing they get an unexpected number from the Virgin Islands, too: VIrginia.

    Another WTF is how they didn't notice that a lot of their customers were from non-existent states like GE, NO, WE, SO, TE, VE.

    What did they think was going on?

  • (cs) in reply to Anonymous

    Anonymous:
    I was wondering how they were getting state names from state abbreviations (to explain why all the orders were assigned to Nebraska)

    You mean until you looked at that list of state abbreviations, right?

  • (cs)

    This is fantabulous (if people get to make up their own state abbreviations, I get to make up my own words). Not only does the programmer not have a clue about US geography, but in their rush to optimize only abbreviating states with a name longer than two characters, they messed up, by upper casing the entire string first, then checking the length, and then taking substring and discarding the rest. Waste! Waste! Waste!

    Sadly, I'm not convinced this is an H1B or a off-shore programmer. I've helped enough of my teacher friends in three states grade homework assignments. Some kids really are this dum (sic).

    --- Boy, if you get any dumber you're going to need to wear a helmet.

  • (cs)

    In honor of a former colleague of mine...

    "I try and try, but I just can't be cynical enough."

  • (cs) in reply to rogthefrog

    The company should have also been wondering where all the bad abbreviations were coming from.

    What state is PE?  (Pennsylvania)  What state is NO (North Dakota and North Carolina)?

    I find it odd that they asked "Why do we have an inordinate amount of Nebraska customers?" rather than "WhereTF are these improper abbreviations coming from?"

  • (cs) in reply to RyGuy

    Damn!  Beaten!  5 posts managed to sneak in within the time it took to post mine. 

  • (cs) in reply to christoofar
    christoofar:
    My guess is that this was an H-1B visa programmer or foreign contract (no Visa, it was written in Bangalore) who may have glanced at the list quickly and has no clue as to U.S. geography.

    In defense of all of the world non-American programmers, you have to be american to be so clueless about geography.
    /I keed
  • (cs) in reply to RyGuy
    RyGuy:

    The company should have also been wondering where all the bad abbreviations were coming from.

    What state is PE?  (Pennsylvania)  What state is NO (North Dakota and North Carolina)?

    I find it odd that they asked "Why do we have an inordinate amount of Nebraska customers?" rather than "WhereTF are these improper abbreviations coming from?"



    Maybe the results were stored in a database with a schema that prevented invalid state abbreviations from being stored. :-)

    More likely, management looked at only the top 5 states or so.
  • (cs) in reply to RyGuy
    RyGuy:

    The company should have also been wondering where all the bad abbreviations were coming from.

    What state is PE?  (Pennsylvania)  What state is NO (North Dakota and North Carolina)?

    I find it odd that they asked "Why do we have an inordinate amount of Nebraska customers?" rather than "WhereTF are these improper abbreviations coming from?"



    That's easily explained:

    SELECT state, incident_count FROM customer_info ORDER BY incident_count

    The saw top results only, and apparently "NE" was there.

        dZ.
  • Paul (unregistered)

    When I saw this I went:

    GetStateAbbreviation("Hawaii") + " " + GetStateAbbreviation("Hawaii") + " " + GetStateAbbreviation("Hawaii")

    Too funny.

  • Anonymous (unregistered) in reply to dubwai
    dubwai:

    Anonymous:
    I was wondering how they were getting state names from state abbreviations (to explain why all the orders were assigned to Nebraska)

    You mean until you looked at that list of state abbreviations, right?

    Wrong!  Read the post again. The point was that there must be a table correctly mapping state names to abbrevations and the programmer didn't use it.

     

  • (cs)

    The inquiries coming from IO would be the ones that would freak me out.
    That a long way off...

  • (cs) in reply to Anonymous
    Anonymous:
    dubwai:

    Anonymous:
    I was wondering how they were getting state names from state abbreviations (to explain why all the orders were assigned to Nebraska)

    You mean until you looked at that list of state abbreviations, right?

    Wrong!  Read the post again. The point was that there must be a table correctly mapping state names to abbrevations and the programmer didn't use it.

    You mean that there's no way someone could have looked at NE and known it stands for Nebraska?  Only a table could do this?

  • (cs) in reply to DZ-Jay
    DZ-Jay:


    That's easily explained:

    SELECT state, incident_count FROM customer_info ORDER BY incident_count


    The saw top results only, and apparently "NE" was there.

    Also response to the 'there must be a table' guy WTF isn't there a foreign key to a state table?  It's WTF that the system was allowing these values.

  • spacey (unregistered) in reply to dubwai

    this isnt real.....


  • Miles Archer (unregistered) in reply to spacey

    This isn't real. How many people type in their full state name. Nope, people type in the postal abbreviation. It's possible that somewhere down the line, the correct abbreviation was expanded to the state name and this dumbass "converted" it back. They also would have the zip code to fall back on.

    I call BS on this one.

     

    (and that damn capcha is not very colorblind friendly)

  • (cs)

    Okay, so it's still a WTF, but not as much as some are saying.  The "optimization" that people are making such a big fuss about is there because most people will use the two letter abbreviation when entering their state online.  This method exists for the people who for some reason take the time to defy convention and enter the full name.  That said, I'll admit it's not too well made...

  • Anon Y. Mouse (unregistered)

    All fixed now!

    public string GetStateAbbreviation(string stateName) { return stateName.SubString(0,2); }

    (this was a joke btw)

  • (cs)

    Weapon recommendation: "AK"-47.
    Dude doesn't even deserve to die by an "MI"-6.

    As a general swipe against the country I love, I was writing a letter to my in-laws, who live in Leimen, Germany.
    I was finishing the address as Liemen, DE 69181, when my wife interrupted and said I had better spell out Deutschland or Germany, or my post was going to end up in Delaware somewhere.
    In the interests of keeping the bashing global, my mother-in-law has posted things to Alexandria, VA, USA, and still had them detour through Egypt.
    Go figure.
    City name overloading--a game we all can play. :)

  • (cs) in reply to Ember
    Ember:
    Okay, so it's still a WTF, but not as much as some are saying.  The "optimization" that people are making such a big fuss about is there because most people will use the two letter abbreviation when entering their state online.  This method exists for the people who for some reason take the time to defy convention and enter the full name.  That said, I'll admit it's not too well made...


    If I ever see a State textbox on some online form that isn't restricted to two characters, I enter the entire name of my state rather than assume that they're going properly map "OK" to "Oklahoma" later on.  Convention be damned!
  • (cs) in reply to UncleMidriff
    Convention be damned!


    Yeah! Fight the machine!
  • Mannix (unregistered)

    Why not limit the field entry to two characters?  Then this method wouldn't need to exist.

    This assumes of course that the entry was made on some sort of form field.

  • Chip (unregistered) in reply to smitty_one_each

    That's perfectly reasonable. The convention is to use the full country name on the envelope, not the ISO country code. (And I think the German convention is to put the postal code before the city.)

    Once when I worked in a mail-order warehouse, i had to deal with an order from "somewhere, N.L." that kept getting misshipped to all kinds of bizarre places until someone clued in that it was from the state of Nuevo Laredo, Mexico.

  • (cs)

    (Big Sigh,  Bangs head against brick wall.)  This is very sad.  I think whom ever wrote this code should be sent back to kindergarten to learn the states and abbreviations again. [:'(]

  • (cs) in reply to Matt B
    Anonymous:
    Charles Nadolski:
    Ahh... a nice, classic, good, old-fashioned WTF.  You made my day :)


    Agreed, there's no usual forum-justifying this one :)

    This is not a WTF.  This is the fastest way to get an abbreviation from a state name.  I bet you could get 100 wrong answers out of this function in the same time it takes to get one right answer with a table lookup.

  • CleverAlias (unregistered) in reply to smitty_one_each

    Even my non-programmer friends in the office thought this was hilarious.

    It's interesting to see that "res2" blames this on the failure of the American educational system, christoofar says it must be the work of foreign (assumed to be non-american) programmers, and WTFer says one must be "american" to make such stupid comments. I, as an american, submit that all such stupidity (as displayed both by the original WTF, and by the tendency to blame it on nationality) is instead an international resource in depressingly abundant supply.

    @strongarm: you didn't make up the word fantabulous, Google returns over 170,000 hits.

    I agree with those who point out that the "optimization" for checking two-character state names is actually probably the one saving grace of this routine. If someone enters a correct abbreviation, it will be passed through unmangled. Of course so will any incorrect abbreviations.

  • Getter (unregistered) in reply to christoofar

    <FONT size=2><FONT size=2>

    Probably If your manager asks you to name all US states you can't even name them being an US citizen or whatever the f** nationality yours is. Then why blame foreign programmers?
    Would you know the state abbreviations of some other foreign country?
    Think before you write Dude!

    - Getter

    </FONT></FONT>
  • (cs) in reply to CleverAlias
    Anonymous:
    @strongarm: you didn't make up the word fantabulous

    answers.com/fantabulous
  • (cs) in reply to smitty_one_each
    smitty_one_each:
    Weapon recommendation: "AK"-47.
    Dude doesn't even deserve to die by an "MI"-6.

    As a general swipe against the country I love, I was writing a letter to my in-laws, who live in Leimen, Germany.
    I was finishing the address as Liemen, DE 69181, when my wife interrupted and said I had better spell out Deutschland or Germany, or my post was going to end up in Delaware somewhere.
    In the interests of keeping the bashing global, my mother-in-law has posted things to Alexandria, VA, USA, and still had them detour through Egypt.
    Go figure.
    City name overloading--a game we all can play. :)


    Why would you address a letter to "Liemen, DE 69181"?  That looks exactly like a city state and zip.  Now, they could probably infer the intended destination by the amount of postage, the fact that there is no 69181 or Leimen in Delaware, and it was addressed to something "Strasse".  But the point of standard state abbreviations and zip codes is to remove the ambiguity from addresses.  Your wife was right; if you're mailing a letter in the US to Germany, then spell it out.  One of my pet peeves is ambiguity created because of laziness. 

Leave a comment on “I Heart Nebraska ”

Log In or post as a guest

Replying to comment #:

« Return to Article