I have no idea how many times I have been happily coding along, only to find that what I thought was a universal law of data conformity was invalid, and meant that I needed to write a lot of special-case code to handle incompatibilities, strange formats, or just simply mistakes.
Today I was finishing up another article for CodeProject when I ran into another one of these. I was trying to pop open the web site for a state, using the state name to form a URL. After doing the first six with no problems, I was lulled into believing all state web site admins were doing something sensible - namely, forming the web site URL based on the state name, like http://www.california.gov. Silly me! Then I got to Connecticut, which uses http://www.ct.gov. I suppose there's some justification. I mean, who wants to type in a long state name? And who can remember if the t's in Connecticut are doubled, like in Massachusetts? And then there was New York (http://www.state.ny.us). This one definitely has a "committee" feel to it. Or maybe a "consultant" feel. Anyway, it's just not normal.
In all I found 8 state web sites that required special handling - i.e., which did not conform to the ideal URL of http://www.state-name.gov. Now I'm curious about what happened with those 8 states. My first thought was, maybe the ideal web site URL was squatted on by a travel agency or something. But when I typed in the ideal URL for those states, most of them displayed Unable to connect messages. So I really don't know why the New York web site admin didn't just redirect from http://www.newyork.gov to http://www.state.ny.us. Across the river in New Jersey, that's exactly what the admin did - you can enter either http://www.newjersey.gov or http://www.nj.gov.
It seems to me that in this case, simpler is better, because it's the state's residents who are most likely trying to access the state web site. If you ask google, they can probably tell you exactly which 8 states have non-ideal URLs, since those states are the ones that everybody has to search for. I have to admit, though, that 16% non-ideal URLs is not bad at all.
