Put the zip code first
131–140 of 330 posts
Re: Put the zip code first
#132Earlier 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.
Re: Put the zip code first
#133Re: Put the zip code first
#134Ok 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.
Re: Put the zip code first
#135> 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.
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
#136Re: Put the zip code first
#137Re: 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…
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
#139“A postal code will belong to a single city” applies: https://news.ycombinator.com/item?id=8907301
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…