Live data from Hacker News

Falsehoods programmers believe about addresses

mjt.me.uk

41–50 of 150 posts

Re: Falsehoods programmers believe about addresses

#41
This article was submitted here nearly two years ago (as you will find out if you click the link to the HN discussion at the bottom of the article). But I thought of one not included in the article.

From Portland's Wikipedia page:

> On the west side, the RiverPlace, John's Landing and South Waterfront Districts lie in a "sixth quadrant" where addresses go higher from west to east toward the river ... East-West addresses in this area are denoted with a leading zero (instead of a minus sign). This means 0246 SW California St. is not the same as 246 SW California St. Many mapping programs are unable to distinguish between the two.

Re: Falsehoods programmers believe about addresses

#43
post #27
post #24

"A road will only have one name" This one's particularly common in Edinburgh. In fact in the example they use - "Regent Road" connects to Princes Street, which becomes Shandwick Place, then Atholl Place. At this point the main fork becomes Dalry Road which then becomes Gorgie Road which becomes Stenhouse Road and then Calder Road - all of which are roughly a straight line: https://www.google.com/maps/dir/Calder+Road,…

There's also the chance a single segment of the road has several names. For example when crossing a bridge or a round-about. Never mind all local names vs official names, old names and translations.

Correct, and indeed having the same name on different sides of the same road. I just recalled another example from Edinburgh[0] where one side of the street is called "Lochrin Buildings" while the other side of the street is called "Gilmore Place" (then both sides of the street become Gilmore Place, which then invisibly changes its name to Granville Place before changing into Polwarth Gardens.

[0] = https://www.google.cz/maps/@55.941979,-3.203582,3a,75y,341.7... (I think the smaller lettered "Gilmore Place" underneath hints at a "yeh we know this is sorta Gilmore Place but not really)

Re: Falsehoods programmers believe about addresses

#45

This article was submitted here nearly two years ago (as you will find out if you click the link to the HN discussion at the bottom of the article). But I thought of one not included in the article. From Portland's Wikipedia page: > On the west side, the RiverPlace, John's Landing and South Waterfront Districts lie in a "sixth quadrant" where addresses go higher from west to east toward the river ... East-West addres…

The city deserves a "bug" for that. Computers might not be able to distinguish between those easily, but I'd bet most humans (especially ones not from Portland) would have no idea either. Addresses are not set in stone -- it's easy enough for them to fix and avoid the entire issue.

edit: I've had my zip code changed within the last few years. That causes the same amount of pain as changing any other part of the address and is done without much fanfare.

Re: Falsehoods programmers believe about addresses

#46

Is it common to believe that post codes don't start with zero? All of New England (ME, MA, NH, CT, RI, VT) have zero starting post codes. Plus apparently a part of New Jersey. Map here: http://en.wikipedia.org/wiki/ZIP_code Also, since it brought up naval vessels, here's the addresses of all US Navy ships: http://www.navy.mil/navydata/ships/lists/ship-fpo.asp Anyways, the post office does a wonderful job delivering m…

Ireland usually does not use post codes :-)

Re: Falsehoods programmers believe about addresses

#47

There are so many formats - is there anniversary format for addresses? In all seriousness, this is where XML and XSDs would really shine!

However, turns out this is a problem that is solved by Google :-)

https://github.com/googlei18n/libaddressinput/wiki/AddressVa...

Re: Falsehoods programmers believe about addresses

#48
post #17

Earlier quoted context omitted.

free text with no validation is the only acceptable answer. Unfortunately, it's not an acceptable answer in practice. In my experience, users aren't clear what to do when presented with a free-form, multi-line text box in which they can enter their address. This results in frequent missing data – users aren't aware they need to include a postal code, or county, or country… This is probably because users are generally…

Of course I'm not saying single multiline textbox for every app out there. That would be crazy. :-) But I'm always surprised how many sites ask for information that will never be used for anything, and assume things like the lenght or characters valid in zip codes or phone numbers. I heard these days on "There is no such thing as a fish" podcast there is a country somewhere where the post office locates places by dir…

That place could be Dubai, as that was how addresses were handled as of a few years ago. In such a quickly developing city, the typical street naming process cannot keep up.

Re: Falsehoods programmers believe about addresses

#49
It's not even true that a single building has only one address, must exist in one town or even in one country. There's a house that has one address in Baarle Hertog (Belgium) and another address in Baarle Nassau (Netherlands), with different house numbers too.

Re: Falsehoods programmers believe about addresses

#50

Of course, they're falsehoods that everyone believes about addresses (except maybe for postal workers), but programmers are the only ones who have to actually think about them. It would be nice to come up with some sort of conclusion or recommendation. Should addresses just be used as one big blob of text, and never parsed at all? should there be individual per-country libraries for parsing them? should we just addre…

I think the consensus is to go with the "big blob of text" approach. You mentioned that postal workers are the only people qualified to parse addresses—let them do it. The validation done on your end shouldn't be much more than asserting that addresses contains non-whitespace characters. I don't know how well this works in practice, but it's the most "correct" thing to do.

Bad mistake you get a metric fuck ton of shit in your data that way.

You should always police your input data properly one big text field is lazy programming that leads to a big technical debt later on.

And yes that does mean handling apostrophes and all those other edge cases properly.

Post reply on HN