1. 27
  1.  

  2. 11

    This is a better article than most “falsehoods programmers believe” posts because it at least takes the time to provide counterexamples, rather than the usual “these are wrong but I won’t tell you why” approach. Though like most “falsehoods” articles it still doesn’t offer much useful guidance for what you should do, only what you shouldn’t.

    In the spirit of which, this page is the best general-purpose compendium I’m aware of for how addresses do (as opposed to don’t) work, within the constraint of expressing addresses in a “send from US to anywhere” way that will be accepted by, and is reasonably likely to be processed as the sender intended by, both the origin and destination postal services.

    1. 3

      Well, at least you can omit leading zeros

      One of Germany’s states has 5-digit zip codes starting with a 0 since our redistribution in ‘93. I’ve always been amazed that this works at all, but maybe I’m just being pessimistic.

      1. 1
        1. 1

          Yes, I wasn’t super precise there, it’s good for a guess of the region though.

      2. 3

        I remember the most amazing one of these, from when I was at Maps; in Turkey, or possibly just in Istanbul, street numbers are assigned in the order the houses were built temporally, not spatially.

        1. 3

          Japan is like this, also.

        2. 3

          Took a second for me to realize it was talking about postal addresses, not memory addresses…

          I recall moving to a new part of the country and being amazed that occasionally you would go by a building with a fractional address, such as “123 1/2 Foobar Drive”, sitting between 123 and 124. I’ve even seen 1/4 and 3/4 addresses, but now those seem downright mundane compared to most of this. Post offices are underrated for how well they work.

          1. 2

            Don’t blame the programmers. Blame the customers and/or product managers.

            I lost count of how many times I was aware of these issues but my attempts at getting this right were thwarted by a product manager or a customer who didn’t have the experience and insisted on useless validation or field formatting because “clearly everybody does it that way”

            1. 2

              Having studied in St. Johns on Newfundland, I appreciate the list of vaguely rude places quoted at the end ;).

              It’s covered in the hiding, but an interesting example: Mannheim in Germany has a grid inner city, which is addressed by coordinates and numbered around the block. An address might be “N4, 15”. I had a number of forms failing there.

              1. 1

                Living in St. John’s, NL (👋🏽) is a constant reminder of how broken a lot of software is. Sometimes sites don’t like the quote and I’ll use “St. Johns”, or they’ll not recognize “St.” and want “Saint John’s”, and in the worst case they’ll exhibit both behaviours and want “Saint Johns” which is most wrong and much too similar in name to “Saint John” that they’ll autofill New Brunswick for the province.

                1. 1

                  Damn, autocorrect. For once, I forgot the apostrophe in “John’s”. The New Brunswick situation was so annoying that Memorial University even included in their acceptance papers that I should double check to book the flights for the right location.

                  It’s a place I’d like to go back to, also, I found my love for theoretical Computer Science there.

              2. 1

                One of my first gigs out of college was as a sales engineer for QAS (later Experian Data Quality). Postal data was the best source for valid addresses. Nevertheless, there were counterexamples of this assumption all the time:

                An address will exist in the country’s postal service’s database

                In spite of having a good product, we always advised our customers to treat address validation like a guide and not as a requirement, allowing corrections to be overridden. There was was only one customer (whom I shan’t name) we couldn’t persuade. They forwarded us several complaints a week from their angry users. We still we couldn’t change their minds.

                Also, If I had a penny for every time I heard this one…

                A zip code corresponds to a single city

                1. 1

                  With all the things that are false about names, time, and now addresses, I wonder if it’d be easier just to list all the things that are true.

                  1. 1

                    Are you worried about what the post office will expect, or do you have some other use case for the addresses?

                  2. 1

                    An address will exist in the country’s postal service’s database Unfortunately, my flat address (1B/2A) didn’t exist in the NZ Post database until I request it be submitted. It seems there was one lady who was in charge of addressing (or so her job title suggested) and that was all it took to get it added.

                    As a positive consequence, a great deal of websites then suddenly started seeing my address as valid. Until then, I had to drop down to just 2A. It didn’t really matter much since you couldn’t physically access our portion of the building from the street anyway.

                    1. 1

                      Whenever I encounter a post about addresses, I like to introduce people to the wonders of Hickory, North Carolina, whose baffling streets are an artifact of a benighted attempt to “systematize” addresses within the city; Tokyo, which has many unnamed streets and uses neighborhoods and blocks as its addressing basis; and Ho Chi Minh City, which does what it feels like (e.g. “3-02 14/A Hẻm 46/2,” or a building with an address that doesn’t actually front the road in the address? entirely possible!).

                      1. 1

                        Post codes and zip codes often get stored as a numeric type, but they don’t behave like numbers. What is the meaning of 90201 - 11011 as zip codes? None, because they’re identifiers not numbers. I don’t know why I would read and treat a post code as a number. I don’t even think of them as strings. Just a “sequence of characters” I can use as an identifier. (And sometimes convert to a string when I need to concatenate.)

                        1. 1

                          I’ve lived in a couple that AFAIK aren’t mentioned here. Currently I’m at ‘xxx yy Ave E’, there also exist ‘xxx yy Ave’, and ‘xxx yy Ave S’ within the same zip code (and xxx yy Ave SW in a different one). I’ve been unable to order things online because the form insists I’m one of the others. I also reasonably regularly get mail with my address and other people’s names, and once a man who seemed rather relieved when I told him his daughter did not live with me.

                          My house also seems to respond to two different addresses, it’s on a corner, and I’ve gotten stuff addressed to “current resident” of what it would be if it were rotated 90 degrees, as well as at least 3 different APT x or UNIT x suffixes (it’s a single family house)

                          University of Washington has its own zip code and addresses are building/box/Seattle, Wa, with no street or building number. That was pretty annoying when I lived in the dorms.

                          1. 1

                            AFAIK libpostal is the best open-source library for address parsing.

                            1. 1

                              This reminds me of the Derek Sivers talk Weird, or just different?.

                              Stories with similar links:

                              1. Falsehoods programmers believe about addresses via calvin 2 years ago | 20 points | 6 comments