- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Hadn't read this thread until today, but things are hot, especially when it comes to saying that foreigners are the problem.
In the US I'd be a foreigner, yet I'd know much better than doing such a WTF, be it in the US or whatever other country, planet, universe or else. It's just a matter of asking how things are done, which a lot of "developers" won't do, wherever they come from.
I, for one, find it a lot offensive that people would say some things I've read:
I might be missing something, but as I see it, this guy (given name CleverAlias) misses the point: this is to blame on stupidity, not (inter)nationality. (A praise for protecting his own national buttock, though)
Also about this other comment:
I can give you that, dZ, because he started it [:P]. But hey, this anonymous (given name Alien) guy is just a bad architect. He didn't think that each particular solution has its own scope, or defined too large a scope when it wasn't needed, which is what you pointed out. Again I say: one might not be familiar with application design, so blame it on nationality-independent lack of knowledge.
Sorry for the long post. Please troll it ASAP [:$]
Admin
The absolute best part is that this is proof C#-ers can be absolute idiots also.
Admin
Oh, people, believe it is real! Back in the mid-80's (I know, a lifetime ago) we were cleaning up data in a railcar tracking system. We found that some rail cars were located in
Puerto RI
So there's of course no town in Rhode Island named "Puerto". It was of course, "Puerto Rico" but had just been entered in a mainframe system which didn't even have this bad GetStateAbbreviation function (or anything else) verifying what was entered in the State field....
It can happen!
Admin
why should foreign programmers care about U.S. geography, when U.S. programmers don't care about the geography in the rest of the world, i've lost count of the number of U.S. company websites that "demand" a zip-code when trying to order goods to Ireland, BTW we don't use a zip code system.
Admin
I was trying to be sarcastic because, as you pointed out, the Anonymous poster started with such a trollish comment; hence my starting the comment with a paraphrasing of his.
I do not promote nor condone prejudice. Every human in this planet has the potential for stupidity. However I, as an American, recognize the problems with our current educational system and our cultural insistence on tolerating and celebrating mediocrity. I just don't like outsiders pointing them out. Call it foolish pride. :)
-dZ.
Admin
Heh, I know what that is. I keep telling my wife that I have this and that against my mother, but I won't let her speak no bad about mommy, because it's not me speaking [;)]
Admin
I think you did miss the point of what was said. It's a little convoluted so I'll translate:
"I, as an american, submit that all such stupidity" = I'm American and I'm saying that all this stupidity
" (as displayed both by the original WTF, and by the tendency to blame it on nationality) " = such as the original code and suggesting it must be caused by foriegners
" is instead an international resource in depressingly abundant supply." = is not limited to one country or the other but is a global problem.
In other words, stupidity is everywhere and it's stupud to suggest otherwise.
Admin
Heh, the city I grew up in (Lincolnwood, IL) actually SWITCHED zipcodes from 60645 to 60712. Also, 60645 was a zipcode for Chicago, and I can't remember if 60712 is also for Skokie. So yes, you do need *all three* identifiers.
On a side note we also changed our area codes twice 312->708->847, and now have to type in the area code *even when* making local calls.
Admin
{/obscenity mode on}
Because, you fucknut... I at least take the fucking time to understand something before I fucking attempt to do something.
Behold, I have written software that was intended to be used by Hispanics living in Texas and Mexico (I am originally from San Antonio). Being a U.S. citizen, I am familiar with Mexico and its culture and took the time to make sure I was correct with forms, dialogs and behavior when dealing with customer demographics of Mexicans (their postal address scheme is rather complicated).
I also know all the f***ing Mexican states and their abbreviations.
So, piss off.
Aguascaliente AGS
Baja California BCN
Baja California Sur BCS
Campeche CAM
Chiapas CHP
Chihuahua CHH
Coahuila COA
Colima COL
Distrito Federal DF
Durango DGO
Guanajuato GTO
Guerrero GRO
Hidalgo HGO
Jalisco JAL
Mexico MEX
Michoacan MICH
Morelos MOR
Nayarit NAY
Nuevo Leon NL
Oaxaca OAX
Puebla PUE
Queretaro QRO
Quintana Roo QR
San Luis Potosi SLP
Sinaloa SIN
Sonora SON
Tabasco TAB
Tamaulipas TAMPS
Tlaxcala TLAX
Veracruz VER
Yucatan YUC
Zacatecas ZAC
Admin
What everyone is missing is that this algorithm is accurate an astounding 40% of the time. If this was a major league baseball player, it would be in the hall of fame.
It's a marvelous night for a Moon Dance
with the stars up above in your eyes.
A fantabulous night to make romance
'Neath the cover of October skies.
(From Moon Dance circa 1973)
Admin
I didn't know the capitols had names..
I think you meant capitals
Admin
Gotta wonder WTF the QA department was.. You'd think something like this would have been picked up.
Admin
Not as in the Latin SIC for 'so', as in SIC TRANSIT GLORIA MUNDAE (so goes the glory of the world)?
Admin
This WTF makes me laugh and laugh, thats good stuff.....
Admin
Washington, DC is the name of a Capitol. Don't think there are any others.
</facetious>
Admin
How... useful.
Admin
In many countries, it's unusual to use a return address, particularly for individuals.
Admin
" 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"
If I was making software for another country, I'd research these things before ignorantly writing my code. A simple 30 seconds on google would provide all the answers you'd need.
Admin
Really? That doesn't seem very smart.
Admin
Oops, I ignorantly thought that this thread was one page long and didn't notice the other two pages. Sorry for my outdated and already spoken response.
Admin
This is why we do not have to worry about offshore outsourcing.
Would that you were right. However, it sounds like this is in code that actually shipped and was actually paid for--so were it done offshore, it would already have had its impact.
Worse, when the next job comes up, do you thing the holders of the purse strings will remember that the state abbreviations were incorrect, or that it cost 40% less than it would have had it been done in-house?
Admin
Not if you address it correctly. All military directed mail will be going to an APO/FPO address, with it's own code. That, plus the 'Military State' code is more than enough to ensure proper routing.
Admin
More funny facts about ZIP codes and international apps: in Austria, the zip code can change within a city: the capital of Austria, Vienna, has 23 districts with 23 different zips. Each starts with 1 (the zip digit of the county of Vienna - each of the nine counties has its own number, and I think 0 is either unused or reserved for some special nation-wide organizations), followed by the district number, and finally a 0, so the sixth district has 1060.
The fourth digit is for individual large mail receivers. They would have their own "post boxes", marked by the fourth digit, so there might well be ten different zips per district, making a total of 230 zips for one city alone.
Most web apps I've seen present a drop-down with the U states, which is simply ignored if the chosen country is anything but USA.
Admin
The word "sic" (which is not an abreviation, therefore it shouldn't really be capitalized) comes from the Latin word "sic", which means "thus" or "so". The english word "sic" (which incidentally also exists in many other languages) can be used in some different ways. I was just pointing out that the original poster was correct in his use.
If I remember correctly, the word was popularized by its use in presciptions, when an unusual dosage was prescribed.
Admin
I believe there was an implied original (or, to be more correct, a class of documents that could be called the original as a collection) -- student essays, in which the original misspelling occurred.
Admin
*shrug* It's the way it's done. Stuff like bank letters generally has a return address, but personal post? Hardly ever. We also lack a postal code system; by the time one became necessary for logistical reasons, post was hugely on the decline due to email and it was judged too expensive.
Admin
Holy uninformed speculation, Batman. A ZIP code directs mail to a USPS installation. Some post offices cover more than one city. Some post offices (like the one in the building I work in) cover a single structure. Three digit ZIP prefixes cover particular, cohesive regions. Perhaps I'm over-emotional, but my problem domain at work (transportation auditing with a focus on the USA) contains the ZIP system. The anoheliocentric garbage folks seem compelled to post is astonishing.
Admin
The international postal code for Germany is D. The localization country code according to ISO3166 is DE. The IOC (International Olympic Committee) country code is GER. So once more, the nice thing about standards is that there's so many to choose from.
Admin
Wow - you learn something new every day! US zip codes are pretty well one-to-one to cities? Here in the UK there's typically one postcode per street, with more for longer thoroughfares. (Type SO19 9EY into google maps and you can lock your missile guidance systems right in on my house.)
I always wondered how you got away with only five digits, and assumed they were duplicated within states (NY12345 != CA12345).
Admin
A ZIP code originally directed to a single Post Office (unique across states.) You can go to the USPS site, type in a naked ZIP code, and it will tell you both the state and the closest city.
ZIP codes start out low (beginning with 0) on the East Coast, and gradually increase as you move West.
Admin
I think that you're incorrect.
With this code:
<font size="2"> GetStateAbbreviation("fun stuff") == "fu"
</font>
Admin
You forgot the uppercase [H] [;)]
public string getStateAbbreviation(string stateName) { return stateName.toUpperCase().substring(0,2); }
You can even tell the locale [;)] obviously in US
public string getStateAbbreviation(string stateName) { return stateName.toUpperCase(Locale.US).substring(0,2); }Admin
That's what we have ZIP+4 for. 9 digit post code for individual blocks/areas.
Admin
Washington is a not the name of Capitol. It's the name of the Capital.
Admin
Half right. Capitol is correct when referring specifically to DC. Hence the comment.
Admin
I'm sure some web sites use a combo box as input with the full state name as the data. Not saying it's smart, just saying it probably happens. Also, it could be a free-form input field where it says State/Province in order to support countries other than the USA.
Admin
Concur with the second Anonymous guy here. I have seen several websites, mostly those who deal with both US and International shipping, as well as military APO/FPO shipping use input boxes to ship to international address which won't have a 2 letter state abbreviation, or the full state name, or the spelled out country, etc.
On a side note, I've noticed a LOT of AC replies claiming falsehood and that some of the WTFs we see aren't actual code, and were made up. Looks like we've finally gotten our own group of specialist trolls; the Non-Believers.
Admin
These are the kind of websites that note that half their international customers have put 90210 into the zipcode box as the form wouldn't accept nothing.
My pet peeve is being having to fill a template for (nnn) nnn nnnn when the phone number is +353 404 nnnnn and my 'cell' is +353 87 nnn nnnn.
Admin
It's odd that so many respondants have said that if they had to come up with a solution for a foreign country they would research how states/provinces/whatever are abbreviated there. I suppose I would, just out of curiosity, but mostly I would just provide a table that mapped names to abbreviations and let the customer worry about the details. That's the beauty of a table-driven approach.
I also find a lot of the speculation about invalid abbreviations like "PE" or "NO" or "SO" interesting. No one seems to have considered that this may be a regional company that gets 99% of its orders from (say) New York and New Jersey. Instead, they assume the data will be distributed across the fruited plain. Of course, it's pointless to speculate.
In the spirit of this WTF, I offer the following highly optimized version:
Admin
The US hasn't added any states in over 50 years. But worldwide, states/provinces/whatever - and indeed, countries - are subject to more frequent change overall. Allowing freetext data entry starts to become very appealing.
Admin
I can name them, in alphabetical order. We learned the 50 States song in elementary school. As for a foreign programmer, no, I wouldn't expect him to know the abbreviations, but if I were in his situation, and had to write code to deal with the abbreviations, I would do the research and find out what they were. I wouldn't guess.
Admin
No, but I would be smart enough to begin googling for the breakdown. In fact, just had to do that recently by adding Mexico and Canada to my system. Amazingly enough if something takes the time they can actually find this type of information in typically one of the top ten google searches.
Think before you write
- Setter
Admin
<FONT face="Courier New">foo? flu? far? fat? fat.</FONT>
<FONT face="Courier New">true. they are just caught in a deadly game of cat and mouse between multinational corporations. they are powerless to influence matters in the global economy.</FONT>
<FONT face="Courier New" size=2>*guitar riff sound*
*pink and aquamarine polygons move around erratically on a static background and converge in the middle. the word "cowabunga" appears and a claymation kid wearing jams and a backwards baseball cap grows outwards from a dot of clay*</FONT>
<FONT face="Courier New" size=2>radical, dude! far out! i was like, surfing today, and i crashed upon a giant ziggurat. no, man, it was tubular. i got to see the flying spaghetti monster, and it was talking, like, backwards, dude. it was righteous!</FONT>
<FONT face="Courier New" size=2>*kid shrinks back into claymation dot, and the polygons disperse*
</FONT><FONT face="Courier New" size=2>*guitar riff sound*</FONT>
Admin
i don't heart nebraska
Admin
lol
i am officially replacing all RAND() functions with emptyset_says()
[compliment, btw]
Admin
Yeah, this is old, and I can usually leave this alone (Lord knows I get enough practice with principle/principal and affect/effect), but when someone's got it ALMOST right and is clearly TRYING, I feel compelled to help.
Capitol refers to a building (or a group of buildings). Capital refers to, among other things, a city which is the seat of government for a particular region.
The Capital of the United States is Washington, DC. The US Capitol is IN Washington, DC, but it's not the entire city, it's that big building with the dome on top at the east end of the Mall on Capitol Hill.