| « Prev | Page 1 | Page 2 | Page 3 | Next » |
|
The American educational system at its finest!
|
|
NEW YORK
NEVADA NEW HAMPSHIRE NEW MEXICO... They're all Nebraska, you know? Not to mention Maine becomes MA.... |
|
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? |
|
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. |
|
This has to be my favorite WTF yet!
|
|
Michigan .... |
|
Wow....not much to say about this one other than WTF?!?[:|] 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!" |
Must be an optimization... why hit the database when you can just make up abbreviations? |
LOL! I totally missed that part - I was blinded by the sheer stupidity of the rest of the code. |
|
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. |
|
This ties in with my other "favorite" (actually very aggravating) WTF
... typified by this email I sent to Yahoo Movies a few years ago: Name: Ross Presser
Subject: Possible Bug Type your feedback here: When I clicked on showtimes for a movie and it retrieved my zip code (from a cookie, from a profile, whatever) which is 08030, it reported that there were no showtimes in my area, and had the 4- digit "8030" in the "enter your zip code" field. The code probably calls it an integer and doesn't check for 5 digits. Remember, California programmers, that several states on the East coast - NJ, MA, RI, and a few more -- have zip codes that start in zero. While Viewing: http://help.yahoo.com/help/movies/ I also have a receipt from homestarrunner.com with the same problem: Thank for ordering from the
Homestar Store. Your order has been accepted. You will receive a shipping confirmation when your order has been shipped. Your Order Number is HR45223 The following Items: *** Ordered *** 1 2020 Trogdor Bumper Stickers (Pk of 2) 1 0166 Trogdor Shirt - Double Extra Large Will be Shipped To: Ross Presser xxxxxxxxxxxxxx
Gloucester City, NJ 8030 United States |
|
Well, the function is GetStateAbbreviation, not GetCorrectStateAbbreviation...
|
Agreed, there's no usual forum-justifying this one :) + |
|
hmm...doesn't check for actual existing states either.
GetStateAbbreviation("fun stuff") == "FU" GetStateAbbreviation("x") == "X" |
Heh. Public String MakeUpYourOwnStateAbbreviation{} Guaranteed to be accurate 38% of the time!
|
|
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") |
|
This is why we do not have to worry about offshore outsourcing.
|
|
I really hope they stored something like a Zip Code in there as well otherwise they have a LOT of bad data...
|
|
I was wondering how they were getting state names from state abbreviations (to explain why all the orders were assigned to Nebraska)
|
|
I think butthead said it best: "uh..huh, huh....you....DUMBASS.....!" |
|
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. |
|
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? |
You mean until you looked at that list of state abbreviations, right? |
|
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. |
|
In honor of a former colleague of mine...
"I try and try, but I just can't be cynical enough." |
|
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?" |
|
Damn! Beaten! 5 posts managed to sneak in within the time it took to post mine.
|
In defense of all of the world non-American programmers, you have to be american to be so clueless about geography. /I keed |
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. |
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. |
|
When I saw this I went:
GetStateAbbreviation("Hawaii") + " " + GetStateAbbreviation("Hawaii") + " " + GetStateAbbreviation("Hawaii") Too funny. |
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.
|
|
The inquiries coming from IO would be the ones that would freak me out.
That a long way off... |
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? |
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. |
|
this isnt real.....
|
|
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) |
|
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... |
|
All fixed now!
public string GetStateAbbreviation(string stateName) { return stateName.SubString(0,2); } (this was a joke btw) |
|
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. :) |
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! |
Yeah! Fight the machine! |
|
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. |
|
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. |
|
(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. [:'(]
|
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. |
|
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. |
|
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? - Getter |
|
|
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. |
| « Prev | Page 1 | Page 2 | Page 3 | Next » |