I like how instead of just rephrasing the website’s premise to make it clear he only cares about the US, he added some ip-based geolocation to select a snarky response based on where you are. Essentially the site argues back to you if you’re not in the US or something. Why did this person even bother creating the website if he’s so hostile and angry.
US-centric. I typed a Mexico postal code (it’s five digits) and got routed to somewhere in Maine. So - yeah the whole “I can tell you’re in the US just by the zip code” premise is entirely flawed.
So I typed my zip code and got Winsconsin, and couldn't change the country to Greece, which is what my zip code actually is for.
Proposing UX improvements is great, but please don't forget the other 95% of the planet.
I fail to see how you can claim this to work for sites which serve areas outside the United States, but have either no ZIP code, an overlapping code, or something else entirely. Germany has 5 digit PLZs, but putting some valid ones in doesn't get a result. It really seems like the author does not think about other countries.
I don't disagree with reordering the entry by relevance, but you have to start with country. That can also be a nice search - it will be a very short lookup, even if you put every country name in every language. Only after that is postal code (of whatever kind - it's only ZIP in the US) relevant.
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.
Falsehoods US programmers believe about addresses: there are no other countries than the US of A, and if there are, they don’t really matter.
This person bought a whole domain for something that doesn’t work for 90% of the world, claiming it does, never even testing their assumption. Great job!
It’s easy enough to say “put the zip first because that will tell you city, state and country in one input”.
What happens to customers not in the United States? They have no zip to enter. Or if they have a postal code of some stripe, it has a different format.
What about folks who are in Turkmenistan, that you’re grumpy about having to scroll past? How are they signing up?
I entered my zip code… well, wrong country: I’m living in Germany.
And even if you knew that, the only thing you could have known from the zip code is the city. At least roughly, because multiple small villages share one zip code.
Or, to cut it short: This doesn’t work at all on a general and global level, so I guess there’s a reason why websites do this differently…
> If you're asking for a ZIP code, use inputmode="numeric"
Does this work for zips? Some zips have a leading 0.
I definitely agree in principle. But - without doxxing myself - I input my zip and the city is not correct. It’s a very close neighboring suburb (where the boundaries are definitely blurry) but it’s not the city on all the legal documents for my current house.
The author complains about country selector drop-downs as part of the address flow, but if you're collecting zip codes you are already assuming United States. I don't think there's a country-inferer from completely generic postal code tool out there yet, is there?
In the UK, it's pretty common for the post code to be the first field in address forms, and for the form to then offer auto-completion for the whole address based on the post code. Postcodes are specific enough that the autocomplete will just give you a handful of addresses (e.g. my postcode will give you just the flats for the building I live in).
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.
It's impressive someone went to the trouble of putting together this angry dreck, and completely ignoring the fact that ZIP codes often span multiple cities/towns, which not only completely invalidates the author's premise, it would populate the fields with wrong information that would have to be manually corrected later.
I’m reading this from UAE where zipcodes don’t exist. I wanted to make a similar post so that when you select UAE as country remove the zip code field. Usually the workaround is to type 000000
Zipcodes are not great for reliably describing locations. They're collections of multiple postal delivery routes, and that's it. There's no guarantee that any given zipcode lies within a single city, or a single state, or that it lies within the boundaries of the US at all, or that it's contiguous, or that it's stationary (there are some for boats), or that any given location only has one, etc., etc. People think this is a good idea because their particular case happens to work well, but zip codes are rife with edge cases.
Besides the issues of the OP approach that many point out on this thread, I also want to point out that the ZIP code input on the example, doesn't have the type=number so my mobile keyboard opens with the whole keys instead of the numeric keyboard, in this case that ZIP codes are only numbers, the type=number will improve accessibility.
Fun facts:
There are zip codes that map to more than one city.
There are zip codes that map to more than one state. (42223)
It should be at least "Put country first, then ask for zip code".
08036 Barcelona, Barcelona, Spain
08036 Hainesport, New Jersey, USA
It does make some sense to go from most general (country) to more specific (address) instead of the opposite, so the form can implement better auto completions.
However in practice postal addresses are not that clean so simple dumb forms are usually better, because it's easy for exceptions to be missed by auto completion algorithms. I would be very pissed if I had to type the zip code above and then correct the wrong guess on every website.
Either you are helpful and guess correctly or you don't guess at all.
It's very interesting how the "you know the city, the state, the country" mantra here is really "you know the city, the state and obviously the country is the USA no other possibilities are considered or worth considering"
Why do we not use ZIP+4 add-on codes anymore? Some sites won't even accept them. If you put that in first, you've narrowed it down to one street at worst, in most cases.
Agreed, but:
JRandomCustomer enters street-number, apt-number, city, state, code ... in that order.
Also, many websites seem to have a negotiation with the browser, where, given: a street address, -> they can populate the other fields.
Definitely not perfect
My postal code is 2200 (København N), and that form didn't do anything for me.
All zip codes are postal codes, but not all postal codes are zip codes.
At my last gig, this sentence was said a lot, and people kept confusing the two, both in code and in daily speech, so maybe colloquially they are the same :)
This sound like it's more efficient - however... (and ignoring the US specific stuff)
Even in forms where I've designed this it breaks my flow as a user. I'm used to suburb state postcode order (I'm an Aussie). It's how we were taught to write the address in school. It's been a pattern for a long time, and the reversal of the fields slows my brain down.
IMHO The better user experience isn't changing the order of the fields. It's honouring auto-complete so the user doesn't have to enter this data in the first place.
In the last couple of years in the uk, address forms ask for you street address and the rest will autocomplete from there - city, postcode. Makes things a lot easier in the way the author suggests
In the Netherlands most websites use a common routing database to map a combination of a ZIP code and house number (+ suffix) to your exact address automatically. Great UX! And naturally depends on good administrative and postal services data quality.
Unfortunately you still need country first. But past that, the point stands well. You'll need to adjust the form based on the country, obviously.
For the US you can use zip-5 to prefill bunch of data and zip+4 practically fills it all out for a lot of addresses.
Each country has some particular nuance though, so it's only as simple as "zip first" or "postcode first" in some locations.
Why don't we learn and use our (short) plus code?
That would have all the desired properties and then some, and would work everywhere on Earth.
Go with 20252 when you know they're just collecting it to send junk mail. Many programmers don't even try to filter for it.
I only ask for zip on our checkout. And get the email from one tap methods.
Like the author I cannot stand how stupid some checkout processes are!
I know some zips covers multiple cities. I would imagine some cross state lines in places too. Doesn’t cover multiple countries either as some have similar formats (5 digits). So there are edge cases that make this infeasible
The Dutch zipcode and the house number are unique. So, to mail something to the Netherlands anywhere from the world, it is enough to write something like: NL 1072CT 4.
The kind of takes that promote the stereotypes of self-centered americans.
The visit Japan website for faster customs clearing does that. Zip first with auto fill. Very nice: https://www.vjw.digital.go.jp
This works really well in Ireland. Eircodes (our late adoption postal codes) resolve to individual addresses rather than areas, so Irish sites mostly do this.
“A postal code will belong to a single city” applies: https://news.ycombinator.com/item?id=8907301
My zip covers two cities, each has a similar street name; 5-digits isn't enough.
I've encountered websites that take the zip and won't let me change the wrongly-assumed city
Autofill seems like a better solution.
Somehow a lot of Japanese websites use this trick. Far more often than USian websites.
ZIP codes don't uniquely identify cities / towns. (Or, in fact, States). Not to mention, they certainly don't work globally...
This failed when I put in an australian postal code.
The US Postal service has some of the most complex software in existence, including some of the most advanced handwriting recognition ever developed.
The fact that mail gets to its destination when it does, as soon as it does, with overall minimal error, is nothing short of amazing.
But some web dev blogger has it All. Figured. Out.
Right.
I'm sure your way is better.
This is big "I could code it in a weekend" HN energy.
The USPS owes you a debt of gratitude for buying a snarky domain and bringing this to their attention after 63 years.
It doesn't take long to type your address. Plus password managers or keyboards often auto fill it. It's not that deep.
When you create a site with a tone this self-righteous and condescending, you should really double check your thinking to make sure there is not some glaring flaw invalidating the premise for the majority of people in the world:
> A US ZIP code is 5 characters. From those 5 characters you can determine the city, the state, and the country. That's 3 fields. Autofilled. From one input.
I guess this is par for the course in Trump's America, but I still feel embarrassed for the creator.
I completely agree with the premise, but if we just ask for the ZIP code first and auto-fill the rest, how am I going to justify my 2-week sprint to build a custom, React-based, fuzzy-searchable, virtualized dropdown component for the 'State' field?
Just kidding xP
Someone needs to write "Falsehoods programmers believe about zip codes" hahahaha ;)
PD: if you don't get the reference, a classic: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-...
> 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 incompetence of the people implementing most web forms, you're asking for disaster here.
Instead, learn to use your browser's autofill feature, and design your sites with it in mind. If you do it right the user literally doesn't have to type a single character. That's even better than typing a numeric code. Sadly even this seems beyond the abilities of the people who implement web forms.