Live data from Hacker News

Put the zip code first

zipcodefirst.com

131–140 of 330 posts

Re: Put the zip code first

#131
The ZIP-first approach assumes a postal code can deterministically resolve the rest of the address, which is rarely true in practice since many codes map to multiple cities or large geographic areas. Making it reliable requires maintaining comprehensive, frequently updated postal datasets or integrating with external geocoding services, which introduces non-trivial operational complexity. Additionally, deviating from standard address field ordering can work against established user expectations and may degrade usability rather than improve it.

Re: Put the zip code first

#132

Earlier quoted context omitted.

These details don't detract from the efficiency. The postal code can prefilter every other field which can frequently narrow down to one. I would leave the ability for the user to override with free form data entry as data isn't perfect and changes over time.

I don't remember asking for "efficiency" in typing out an address, something we teach children how to do. It doesn't seem like a societal problem worth iterating over. These tools are more than often wrong, and cause more grief for the user than any potential help it could provide. There is no developer in the world that knows this data better than the person typing it into the form.

I'd like any person or system asking for my information one field at a time to minimize my time and effort to give it to them.

Re: Put the zip code first

#134
post #7
post #3

Ok but that only fetches the codes from the US, so now a non-US resident will start with their zip code and end up with random ass place on the other side of the globe. Now not only I still have to fill in the fields, but also clear them first.

Obviously put country first, then whatever the equivalent of a ZIP code is second. In the UK, a post code gets you down to around 15-16 delivery addresses on average. No-one there really _ever_ needs to type an address.

I have a better idea. How about we just let the users input their own addresses? These days, most browsers autofill addresses anyway.

Re: Put the zip code first

#135
post #69

> From those 5 characters you can determine the city, the state, and the country False. Many zip codes include more than one city, and some even cross multiple states. And you can't always tell the difference between codes from different countries. Now you're not just instantly filling the rest of the form, you're implementing fancy multi-country filtering logic, editable drop downs, etc. Given the obvious incompeten…

This 1000 times. I’ve tried implementing what OP has mentioned, and quickly learned it isn’t possible. A city can also exist in multiple zip codes. And there can be multiple cities with the same name in the same state. So, to be safe, you have to enter city, state, and zip.

The postcode doesn't tell the whole story. But what you can do is use an IP geolocation service which should narrow down your location enough, so that typing in the entire address is no longer necessary.

I.e. using something like https://ipinfo.io/json and then typing in a full postcode and street name + number should work well in most cases.

Re: Put the zip code first

#138

> From those 5 characters you can determine the city, the state, and the country False. Many zip codes include more than one city, and some even cross multiple states. And you can't always tell the difference between codes from different countries. Now you're not just instantly filling the rest of the form, you're implementing fancy multi-country filtering logic, editable drop downs, etc. Given the obvious incompeten…

USPS doesn't care; each ZIP code has a single preferred city name and a list of acceptable alternate city names to account for cases in which a ZIP code spans multiple cities. However, USPS's address validation will prefer to use the preferred city name for the ZIP regardless of whether the recipient actually lives within the boundaries of that city. That's because USPS has opted to organize addressing entirely around the ZIP codes, and other political boundaries are irrelevant except in cases of problems interpreting the address.

This does mean that you might autofill a city name that is "wrong" in the view of the person completing the address form, but much of the bulk mail they receive probably uses that city name anyway.

Technically speaking ZIP codes are not "supposed" to span states but, in exceptional cases, some do. In this case USPS handles it the same way: the state of the preferred city is the preferred state for the ZIP code.

The preferred city is almost always the location of the post office serving the ZIP, which makes this situation fairly intuitive. You can find some interesting edge cases where a post office in located in a suburb city, resulting in a ZIP that includes part of a major city having the suburb as its preferred city name.

You can look up the city name and alternates for a ZIP here: https://tools.usps.com/zip-code-lookup.htm?citybyzipcode and the Domestic Mailing Manual covers this, although it's scattered across several sections and mostly part of how the City State database (the database used for validating city and state names in addresses) works.

Re: Put the zip code first

#140

> From those 5 characters you can determine the city, the state, and the country False. Many zip codes include more than one city, and some even cross multiple states. And you can't always tell the difference between codes from different countries. Now you're not just instantly filling the rest of the form, you're implementing fancy multi-country filtering logic, editable drop downs, etc. Given the obvious incompeten…

I'm always struck at how the state abbreviations are alphabetical order of state name. This leads to the abbreviation not being in strict alphabetical order.
Post reply on HN