13 ms·
Put the zip code first
- hknceykbx 7mo agoHow about autofilling zip code
- mttjj 7mo agoI 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.
- aewens 7mo agoMy brother’s house is in the same boat. Unfortunately, not all ZIP codes exclusively belong to one city.
- matthewbauer 7mo agoYeah city is not fully a function of zip. ~I think state is though.~* I believe when multiple cities share a zip code USPS uses the larger one. Usually the wrong city will get delivered though, probably not guaranteed. * correcting myself, some zip codes do cross state lines
- krater23 7mo agoCan't say anything about the US, but in Germany when more than one cities have the same zip code it's just not important because there is only one sorting center for all cities with the same zip and they just sort per street address.
- bob1029 7mo agoZip code is a very powerful factor from a PII perspective. https://dataprivacylab.org/projects/identifiability/index.html https://dataprivacylab.org/projects/identifiability/index.ht...
- ezfe 7mo agoLegal address doesn't matter for mail, and all of this stuff is about mail/shipping. This includes billing addresses. I would have assumed that you knew that. I know people whose ZIP code belongs to a neighboring town (because mail works that way) and it basically becomes their de-facto address.
- petee 7mo agoSome areas have duplicate, or very similar street names (ie, 'ave' vs. 'street') I don't think its that much of an ask that a website lets you enter your address correctly
- esrauch 7mo agoYeah it should auto fill but not stop you from changing it, best experience 98% of the time. I just looked it up and apparently there's some cases of zip codes that do go across state lines too, but it's rare.
- ezfe 7mo agoThere is a canonical full address for every mailbox in the US. Would be curious to see what these houses show. My experience living in towns that received mail from other towns is your canonical address IS the other town.
- esrauch 7mo agoFWIW I have received mail from the USPS in places that had no canonical full address as well. It's not the case in reality that the USPS only delivers mail to mailboxes that have an associated entry in their canonical database here in "messy" reality.
- ezfe 7mo agoStreet name isn’t auto completed here…
- mttjj 7mo ago
- diath 7mo agoOk 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.
- jen20 7mo agoObviously 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.
- loloquwowndueo 7mo ago“Obviously” didn’t read the article. Not having to pick the country is literally the premise! “I type 90210. You now know I'm in Beverly Hills, California, United States. You didn't need me to tell you that. You didn't need a dropdown. You didn't need me to scroll past Turkmenistan.”
- scottlamb 7mo ago"Obviously" the article is wrong, as pointed out by the grandparent of your comment (and several others in the comments). I won't violate the site guidelines by suggesting you didn't read it.
- loloquwowndueo 7mo agoI did read it.
- scottlamb 7mo agoGreat. Pretty sure jen20 did too; they are replying to a comment pointing out the article is wrong and suggesting a compromise between the web default "enter all your address, then the zipcode" and the article's "you don't ever need to touch the country, state, or city fields" that is closer to working beyond the US. In that context, I find it strange and rude that you're suggesting they didn't read the article.
- stavros 7mo agoSo 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.
- yardstick 7mo agoAgreed. I suppose they could lookup based on your IP to pre-select a country (which you can still override if you need to aka VPNs and ordering from a different country), and based on that then ask for a postcode.
- 8n4vidtmkvmk 7mo agoI thought your 95% was off but 300 mil/8000 mil is about 4% population for US!
- mikehall314 7mo agoIt’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?
- acidburnNSA 7mo agoI think they can just skip the zip code entry and enter everything else as usual.
- kawsper 7mo agoA lot of the times both "zipcode" and "state" are mandatory fields. Zipcode is easy, the platform likely wants my postal code. You have to be a little bit more creative with state, sometimes "We don't have any states" is fun to see printed on your address label on a parcel, other times "Denmark" could be considered a state in the EU and that can be an answer, but most times "N/A" is enough.
- krater23 7mo agoThis already works on most shop systems in Germany. The OP just have to learn that zip codes aren't international. You can't know everything. Why this automation isn't implemented when you select USA as country...I don't know, but when you select Germany it works.
- dgeiser13 7mo agoSome zip codes cover multiple cities.
- acidburnNSA 7mo agoYeah, but autofilling everything down to the neighboring city is still a huge improvement.
- wenc 7mo agoI think that can solved using a city dropdown there’s ambiguity. This is not new. Some checkouts do start with zip code and they feel much more efficient. (US only delivery, so country already assumed)
- lsaferite 7mo agoA few cover multiple states. See: https://peter-horton.com/2022/12/30/zip-codes-zctas-and-zctas-that-cross-state-boundaries/ https://peter-horton.com/2022/12/30/zip-codes-zctas-and-zcta...
- loloquwowndueo 7mo agoUS-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.
- NicuCalcea 7mo agoYup, the second sentence in the post is incorrect. > From those 5 characters you can determine the city, the state, and the country. You can't infer the country from a postcode.
- hyperhello 7mo agoIn the example, you might at least be able to cut down your menu choices to Maine or Mexico.
- NicuCalcea 7mo agoThat assumes the existence of a reliable, free postcode API of all addresses on the planet. I did a very brief search, and none of the commercial offerings I could test recognised the postcode of the Eastern European neighbourhood I was born in. Also, like half of African countries don't have postcodes. It's just not a good system.
- gmueckl 7mo agoOnly if you're limiting yourself tok those two countries. A lot of countries use the entirety of a 4 or 5 digit range for their codes. Any given 5 digit number is likely a valid ZIP code in at least half dozen countries.
- deleted 7mo ago[deleted]
- II2II 7mo agoThe form stopped accepting input at five characters. I could not enter a "zip code" for my country even if I wanted to. Even if they fixed that, there are other issues. (You pretty much need to cross-reference it with a database, which assumes said database even exists.)
- YokoZar 7mo agoThe 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?
- lsaferite 7mo agoYou could maybe do it for some subset of countries, but it's not simple. And some countries don't have post codes.
- nottorp 7mo ago> if you're collecting zip codes you are already assuming United States From outside the US: I always thought "zip code" is just what you USers call a postal code. I only found out it's a trademark today, from this HN discussion. So most people outside the US will see "zip code" and think "oh, they mean postal code but they have this weird term for it".
- quesera 7mo agoIt's "ZIP Code™", trademarked by the US Postal Service (this is mostly to prevent others from misusing the name). It is exactly equivalent to a postal code, and most US residents will know both terms, although they will always say "ZIP". ZIP is an acronym for "Zone Improvement Plan", but no one knows that and it's not meaningful if you do!
- lsaferite 7mo agoUnfortunately 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.
- jshchnz 7mo agopreach
- talkvoix 7mo agoI 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
- conductr 7mo agoI 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
- zettabomb 7mo agoI 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.
- kiliankoe 7mo agoAs a side note, it's 2026, and there's still German software that thinks our postal codes are integers. Mine has a leading zero, and it hasn't been too long since I've seen (German-built!) software that silently truncates the 0 and then complains that it's just 4 digits and should be 5.
- quesera 7mo agoThis happens in the US too, and even if you're wise enough to treat postal codes as strings (which they are) and not integers, someone is going to paste the data into Excel which will promptly blow things up on you anyway.
- Breza 7mo agoHead of data science at a corporation here. People pasting into Excel has been a bane of my job for over a decade.
- quesera 7mo agoYes! I'm sure you know this, but for anyone with similar problems: You can disable this conversion "feature" in the Excel "Automatic Data Conversions" preference pane. ...and I hope you have better luck getting people in your company to remember this than I have! :)
- smallnix 7mo agoThe visit Japan website for faster customs clearing does that. Zip first with auto fill. Very nice: https://www.vjw.digital.go.jp https://www.vjw.digital.go.jp
- fenwick67 7mo agoGalaxy brain: address should just be a multi-line field
- altairprime 7mo ago“A postal code will belong to a single city” applies: https://news.ycombinator.com/item?id=8907301 https://news.ycombinator.com/item?id=8907301
- deleted 7mo ago[deleted]
- goloroden 7mo agoI 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…
- exmadscientist 7mo agoRelated, on the country drop-down front: please put the United States (or whatever your customers' main country is) at the top. You can probably tell I want the US from a combination of, you know, 99% of your sales being to the US and my language being set to English. And, sure, put Canada and even the UK next to it. Go wild, have the top ten English-speaking countries there if you like! It makes things so much easier. The trick, then, is that you don't remove anything from the alphabetical list. With modern computer technology, we can have two places to find something! So if I miss your fancy shortcut, or it's not applicable to me, everything will still be in the regular old familiar place. It just works.
- hbrav 7mo agoThis generates a really annoying features with some browsers. Suppose I want to select "United Kingdom". I open the drop-down and there are all the countries in alphabetical order, plus "United States" at the top of the list. I hit the 'U' key. It does not take me to the alphabetically listed countries beginning with 'U', it takes me to the "United States" entry at the top of the list. I might be able to type 'U-N-I-T-E-D-K' and get to the "United Kingdom" entry, but there are browsers where that does not work. (Nor does repeatedly hitting 'U' bring me to the later 'U' entries.)
- Sharparam 7mo ago> and my language being set to English Absolutely not. Language should never have any merit at all on country selection. As a Swede that prefers the English language for tech and internet stuff, sites that try to be smart about country selection based on browser language or language selection based on IP location can kindly go die in a fire. An extra hot fire if they don't even let you manually override the automatic "detection".
- exmadscientist 7mo agoThat's why I also mentioned US companies with primarily US clienteles. I think that in that case, "browser is sending en-US language" and even say "IP geo-resolves to the US" is a strong enough signal to justify prioritizing "United States" in a country dropdown. It helps a decent fraction of your customers, and for the ones where it's wrong, they go from picking their country in the full drop-down to... picking their country in the full drop-down. The downside is microscopic on this one. It's not evil like forced language/region selection with no fix available.
- RASBR89 7mo agoIn 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
- justaboutanyone 7mo agoThis failed when I put in an australian postal code.
- petee 7mo agoMy 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
- nomdep 7mo agoIf you’re going to ask for a country, ask for it first. Zip codes repeat across countries, you know.
- throwaway0665 7mo agoIt doesn't take long to type your address. Plus password managers or keyboards often auto fill it. It's not that deep.
- aleph_minus_one 7mo agoI guess a better proposal would be: - Put the country first - Put the zip code second
- deleted 7mo ago[deleted]
- modeless 7mo ago> 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.
- bicx 7mo agoThis 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.
- ghostly_s 7mo ago> A city can also exist in multiple zip codes. And there can be multiple cities with the same name in the same state. These are reasons you cannot deduce the Zip from the city, not the opposite. A ZIP+4 actually encodes all other information for a US address.
- Someone1234 7mo agoNobody knows their +4 code. You cannot ask for information 90%+ of people won't have.
- tokyobreakfast 7mo agoOf course they do. Let me uh just grab my utility bill...
- 7mo ago
- senadir 7mo agoThe kind of takes that promote the stereotypes of self-centered americans.
- sib 7mo agoZIP codes don't uniquely identify cities / towns. (Or, in fact, States). Not to mention, they certainly don't work globally...
- phippsytech 7mo agoThis 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.
- tokyobreakfast 7mo agoThe 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.
- kawsper 7mo agoMy 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 :)
- pbnjay 7mo agoUm a lot of US zip codes map to multiple cities. Some even to multiple states. If you build a picker for city/state this works fine but your premise is easily refuted if you look at the data! Zip codes map to postal routes, not polygons
- djoldman 7mo agoFun facts: There are zip codes that map to more than one city. There are zip codes that map to more than one state. (42223)
- kazinator 7mo agoLooks like that is just an area that straddles the border between Tennessee and Kenucky. Though it maps to more than one state, it is a single, connected region. Line houses are even more interesting: https://en.wikipedia.org/wiki/Line_house https://en.wikipedia.org/wiki/Line_house
- macintux 7mo agoAnd as others are pointing out, there are zip codes which appear across multiple countries.
- apendleton 7mo agoZipcodes 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.
- enraged_camel 7mo agoI would say this doesn't actually work well for UX, because people are more likely to know their street address and city than their zip code. Personally, every time I've moved over the years, it took a few weeks for me to internalize my new zip code.
- paulddraper 7mo agoFlawed premise. This works within a country, but not between countries. For example 77520 is the zip code of Cancun, Mexico and Baytown, Texas. --- Needs to be country + zip code (postal code).
- dasil003 7mo agoWhen 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.
- valicord 7mo ago"You can determine any country as long as that county is USA"
- rishikeshs 7mo agoI’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
- junon 7mo ago"See how you typed 5 numbers and three fields filled themselves in?" Nope! Didn't see that. Seems the zip code registry doesn't have a number of German zip codes.
- joshellington 7mo agoI wish I could downvote this. Please don’t do this folks. Editing “guessed” filled inputs when they’re incorrect is a higher UX bar of effort than browser autofill or even just typing it (especially on mobile). Plus a non-zero number of users will just not correct or be confused and abandon.
- lejalv 7mo agoWhy 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. https://en.wikipedia.org/wiki/Open_Location_Code https://en.wikipedia.org/wiki/Open_Location_Code
- slartibardfast0 7mo agoThis works really well in Ireland. Eircodes (our late adoption postal codes) resolve to individual addresses rather than areas, so Irish sites mostly do this.
- maxk42 7mo agoThe US also has postal codes that map to individual addresses. People just don't know them.
- TRiG_Ireland 7mo agoYou have to be careful with this. Building sites (translate that into American as "houses under construction") may want to order stuff, but won't yet have eircodes. Indeed, I believe that they're issued only twice a year, so new-built houses may not have them either. So you cannot make it a required field.
- slartibardfast0 7mo agoyes, once the 'footings' are in you need to order an eircode straight away, no fibre-to-the-home without any eircode :)
- deleted 7mo ago[deleted]
- xorgun 7mo ago[dead]
- fjfaase 7mo agoThe 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.
- tokyobreakfast 7mo agoIt'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.
- loloquwowndueo 7mo agoLe sigh. It has now a disclaimer at the top. “Hello from across the pond (or whichever body of water separates us). This is a US ZIP code website. We are aware that other countries exist.” This guy just keeps digging himself into a hole of ignorance - is he aware of Mexico? Canada?
- 8organicbits 7mo agoThere's a few messages it can show: const msgs = [ `Yes, we know ${country} exists. We're very proud of you.<br><br>This site is about US address forms — the ones that make <em>Americans</em> scroll past Turkmenistan 200 times a year. You have your own postal code problems. We believe in you.`, `We see you're visiting from ${country}. Welcome. We regret to inform you that this rant is specifically about American address forms, which are — and we cannot stress this enough — <em>unbelievably bad</em>.<br><br>Your country probably has its own postal code horrors. We'd love to hear about them: <a href='mailto:shame@zipcodefirst.com'>shame@zipcodefirst.com</a>`, `Hello from across the pond (or whichever body of water separates us from ${country}). This is a US ZIP code website. We are aware that other countries exist. We just have 160 million addresses and a 50-state dropdown to be mad about first.<br><br>Your frustrations are valid. Your postal codes are also useful. Put them first too.` ];
- watusername 7mo agoNone of which reflect well on the author. The "We're very proud of you." is exceedingly condescending.
- loloquwowndueo 7mo agoYeah, that was added after the onslaught. I’m in Canada and got the “across the pond” one. Lol.
- Sharparam 7mo agoI think the author is spending more effort on this international banner system now than the rest of the site. I got one that seems to be tailor-made for Sweden (mentioning our furniture (IKEA)).
- morganf 7mo agoSomeone 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-believe-about-names/ https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-...
- rendx 7mo agoHere you go (2013): https://www.mjt.me.uk/posts/falsehoods-programmers-believe-about-addresses/ https://www.mjt.me.uk/posts/falsehoods-programmers-believe-a... Also: the awesome-falsehood collection: https://github.com/kdeldycke/awesome-falsehood https://github.com/kdeldycke/awesome-falsehood
- evrimoztamur 7mo agoIn 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.
- pentagrama 7mo agoBesides 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.
- pdpi 7mo agoIn 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).
- deadlocked 7mo agoIrish post codes will get you the exact unit within the flats.
- jmull 7mo agoAutofill seems like a better solution.
- billforsternz 7mo agoIt'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"
- agnishom 7mo agoSomehow a lot of Japanese websites use this trick. Far more often than USian websites.
- zackify 7mo agoI 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!
- sph 7mo agoFalsehoods 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!
- 1970-01-01 7mo agoThe name and shame tactic is underrated these days. :)
- marcellus23 7mo agoI don't disagree with you generally but does he really claim it does? The entire page only mentions US, near as I can tell.
- krater23 7mo agoHe just doesn't understood that every country has his own zip codes. He just comes from the land of the free invention of units of measurement ;)
- chneu 7mo agoFreedumb
- fellowniusmonk 7mo agoYeah, this is 100% an instant classic in the lies programmers believe series. How long have we had browser auto complete for addresses? A long time, I assume it's devs like this one who just can't be bothered to support it and have to pretend their flawed approach is somehow faster than literal auto complete.
- jiveturkey 7mo agoratio'd
- rezmoss 7mo ago[dead]
- zeehio 7mo agoIt 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.
- kube-system 7mo agoOr rather “country first and then postal code”. Zip code is a postal code but only one postal code is a zip code.
- 1970-01-01 7mo agoGo with 20252 when you know they're just collecting it to send junk mail. Many programmers don't even try to filter for it.
- hirvi74 7mo agoWhile interesting, it would take me more time to implement and validate this logic than it would take the user to enter the data.
- sghaz 7mo agoThe 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.
- deleted 7mo ago[deleted]
- kube-system 7mo ago> You didn't need me to scroll past Turkmenistan. You’d absolutely have to determine that you’re in the US before asking for zip code.
- samtregar3 7mo ago[dead]
- angrydev 7mo agoAutofill
- cranky908canuck 7mo agoAgreed, 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
- deleted 7mo ago[deleted]
- LeoPanthera 7mo agoWhy 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.
- aed 7mo ago> If you're asking for a ZIP code, use inputmode="numeric" Does this work for zips? Some zips have a leading 0.
- loloquwowndueo 7mo agoI 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.
- sevenseacat 7mo agoI didn't get a snarky response viewing it from Australia!
- WBrentWilliams 7mo agoEhh... US-centric. Better to use significance order: Country, then postal (most countries have postal), then region, city, and street address. Best, however, is to _not_ separate the address into fields. Instead, allow a free text field for the person doing data entry to put in the address in _their_ format and then parse it on the backend. This gets you the most flexibility and allows you to encounter and handle corner cases by using (my favorite test data) public addresses from all over the world. _I_ routinely test my address entry by Googling McDonald's locations and feeding them into my system. Handle an inscrutable address like any other bad data and say, politely, that your system does not understand the data. All that said, free-form entry is a hard sell. My _customers_ expect field data entry, so I implement field data entry. I just re-order my checks to be more forgiving until the data entry is complete. I was implementing a customer service address entry using significance order 25 years ago. As I already _knew_ that I had a US-centric customer base (we sold long distance to sorority and fraternity members), entering US ZIP first saved a lot of time and more highly leveraged the US postal address cleaner that we had already purchased for our mass marketing mailers. The people working the call center _loved_ it, as they could focus more on their call turn-over than on data entry.
- tomjakubowski 7mo agoUse ZIP Code: the last word in mail address.
- c0balt 7mo agoAwesome idea, IF you are US only and don't cover edge cases and (want to depend on an external API or want to have some sort of eventually outdated map of city <> postcode). It is possible to do this properly, e. G., DHL and UPS do a somewhat okay job of it but isn't easy.
- jdlyga 7mo agoZip codes do not have a one to one relationship to cities in the US. It's a common misconception. It's true about 90% of the time, but there are a lot of outliers. I used to work with GIS data and there are a ton of exceptions.
- DHPersonal 7mo agoAddress entries are the weirdest places of frustration. Business clients want Google Places to make address input easier. This user wants a single ZIP code entry to begin the process. Why is adding one’s own address manually that huge of a hurdle that we have to separate the user from the inputs? If there is one person in the world who should know my address, it’s me: why then put such an effort into building a site that takes away my ability to enter my address?
- hakfoo 7mo agoIt's probably a turtles-all-the-way-down problem. Three or four blank lines is probably the least hostile and most foolproof way to handle addresses. But the cart software has distinct address-line-1, address-line-2, city, state, zip-code fields. And the CRM they export into has similar fields. Probably to be compatible with some further pipeline of tooling going back decades. I suspect if you go back far enough it ends at pre-/semi-computerized data processing systems which would print addressed envelopes and documents from stacks of Hollerith cards, using extremely rigid fixed formats that were probably fine for their original buyers, likely US-centric and old enough that they were just getting it to the right city and letting the local postman figure out the nonsense on the envelope.
- hluska 7mo agoIn a similar tone, it’s 2026. Why are we still messing with form ordering instead of leaning into autofill? So somehow it makes more sense to change every single address form in existence to a non standard order because…why exactly? There’s a whole world outside of the United States with many formats for postal codes. It’s more efficient to just use autofill…
- twodave 7mo agoMost sites I use auto-fill city, state and zip once I type the street address, which is the 1 piece of my address that can’t be guessed from any of the others. So I’d say that’s probably the optimal path for most people, at least in the US. I’m sure people from other countries scoff at the US address suggestion and go straight for the country box from the beginning.
- vscode-rest 7mo agoI wonder if people had a similarly negative reaction when someone first proposed speculative execution in processor pipelines. “This is is a terrible idea, you’re telling me you will make 99% of cases way faster but completely ignore the 1% that will be slightly slower? Unbelievable.” If you have SA that most of your customers are in USA, this is a good idea. If not, maybe use your brain a bit and figure out if it can be adapted to something which will work for your customer base.
- TRiG_Ireland 7mo agoI'm trying to work out what SA means.
- vscode-rest 7mo agoSituational Awareness
- hysan 7mo agoIMO, the spirit of the idea is to put higher information density fields first, and let that smooth out the UX for the remaining fields as you go downwards. Yes, there will be exceptions but that only matters if you’re trying to absolve the user of all work for 100% of situations. Trying to do that is a fools errand. Invert the order and use the information gathered to make inputting the rest simpler for 80% of the users. Then make it easy for the other 20% to course correct (ex: don’t disable autofilled fields, highlight all text when tabbing to the next field, etc). I think this pattern is a good one to keep in mind, but not blindly follow, when designing the UX of a UI.
- teiferer 7mo agoI live in 10115. No, not New York. It's Berlin, Germany. I used to live in M6C1B5. By forcing "numeric" on the zip code field, you'd immediately loose all Canadians. This article is so US centric it's not even funny.
- chrysoprace 7mo agoAs others have pointed out this is just US-centric, and doesn't work for most countries. The best option I can see is to have an autocomplete, and allow manual addresses with a country-specific form based on a country selection (or detection).
- krater23 7mo agoMaybe first start with using non subhuman units like meter and celsius, then learn that there are other countries than 'The United States of America' and then fix that with the zip codes. ;P p.s.: Don't takt this too serious, have just a dark kind of humor.
- muppetman 7mo agoThe ignorance of this post to the rest of the world is amazing.
- fsckboy 7mo agothere should be one text box with multiple lines and you enter your address the way you would write it on an envelope. works internationally, gets stuff delivered. If the postal service can parse it, so can a website. Typing in your address will go so much faster than having to read the tags and navigate for every piece they are asking for. any redundancy can be used for error checking which is a good idea. the "fields", like the goggles, they do nothing
- hettygreen 7mo ago[flagged]
- bichiliad 7mo agoBesides the technical constraints (the zip code can't always tell you the city, etc), the zip code is more of a checksum to make sure the address you typed makes sense. I think you could probably get around the imperfections by making the city / state / zip be things suggested to you, whether in an autocomplete or by making them first in a dropdown. The imperfection of a zip code in encoding a city name doesn't mean that the frustration of filling out addresses isn't a real one!
- estebarb 7mo agoI tried to put my postal code and it wrongly assumed that I live in the United States. The zip first suggestion seems that would be really inconvenient for around 95.8% of the world population.
- deleted 7mo ago[deleted]
- efitz 7mo agoIm reading through all these comments and it amazes me how the perfect is the enemy of the good, for many computer people. Ofc there are edge cases. So since there exist a handful of edge cases where a zip code maps to two states, or the more frequent (but irrelevant in the US) case of two or more city names per zip code, we should make everyone suffer? Ofc if you are making a web form you should ask for the zip code first, and auto complete state and city. Let the user edit them if they don’t like what you chose. Or do as some have suggested here and present the official USPS data as a drop down of 2 states or 2-3 cities; thats way better than having to type all of it. And I curse everyone who thinks it’s a good idea to break zip code or phone number or OTP into multiple fields, or if you’re too lazy to set the input type to number.
- sevenseacat 7mo agoEdge cases like every non-US country in the world???
- sakesun 7mo agoLikewise, we should all use ISO 8601 date format.
- zjp 7mo agoAt least detect my country by IP range and put "US" at the top of the country dropdown.
- aeternum 7mo agoJust make sure it works well with autocomplete. No additional fanciness or weird rearranging of fields is needed.
- b5n 7mo agoAll the extra steps serve as some type of verification + data collection. The devs know how to make the experience better, but they get paid to implement some mbas mining scheme. The future is ok but mostly sucks.
- pauliusjac 7mo agoWe tried this on one of our e-commerce sites and it mostly worked. But we had to scrap it once we started expanding internationally. On a personal note, please just let my browser autofill my address.
- petersumskas 7mo agoKeep going! The idea has merit. But it is US centric. I tried the example with my local post code and of course it didn’t work as I’m not in the US.
- Charon77 7mo agoIn Japanese websites this is pretty much the norm. Govt, bank, marketplace, you name it. fills the address until the block, where you'll need to fill the rest of the numbers until your house address / room number
- LowLevelKernel 7mo agoPhew! Somebody had to say it. Finally thank you
- timvisee 7mo agoThe majority of comments complains about non-USA. But the author clearly states: > Fine, maybe country first It's an example - limit typing. But adjust it to your own use case.
- jeffrallen 7mo agoA little too US centric. With a bit more effort it would detect all of the G20's post code formats and fill in the country name automatically. (Sparing me the frustration of trying to choose between Switzerland and Swaziland in the 6 point font you chose for the pop-up.) Also, don't be a dick. Have some empathy for your reader. Half of the UI designers you are talking to don't have a choice in how it works. Their colleagues chose some stupid framework which they can't customize. The other half didn't even want to do this task, they just got it assigned to them by some PM they don't respect (who, in turn, does not respect any advice coming from UI designers), and they are doing the minimum they possibly can while applying to other jobs that suck less.
- adangert 7mo agoIt's generally easier to start typing your street address (maybe 4-5 characters), see an auto fill, click your address and all information, including the zip is already filled out. If you started with just the zip you still have to type your street address afterwards.
- thiht 7mo ago> I type 90210. You now know I'm in Beverly Hills, California, United States You CAN’T get the country from a zip code. France also use 5 digits zip code for example. You must ask for the country before asking for the zip code, even if you pre fill it with a sane default, like the main country you operate in.
- rerdavies 7mo agoHow about you put the address line first, and I press the TAB key to autofill.
- tsoukase 7mo agoWhile using imperial system and MM/DD/YY for dates, I doubt zip codes will follow a digital-frendly and world-aligned format.
- osherse 7mo agoYou know this is how we do it in the uk. Put in the post code then select the address. Post codes here are also really specific so usually it’s a few dozen addresses to pick from.
- tomburgs 7mo agodid an llm write this? how is it so confidently ignoring rest of the planet? despite the obvious flaws others have already noted, plenty of countries include letters in their zipcodes, rendering the "Invoke the right keyboard" argument not only incorrect but potentially damaging to users or businesses who choose to follow this. if the website won't allow me to physically enter my zipcode, i'll just take my business elsewhere.
- BrianHenryIE 7mo agoWooCommerce implementation I wrote a few years ago, US, Ireland, Japan, India: https://github.com/BrianHenryIE/bh-wc-postcode-address-autofill https://github.com/BrianHenryIE/bh-wc-postcode-address-autof...
- zackwu 7mo agoAs pointed out by many comments, the post seems US-centric and using zip code doesn't work for all countries. But just for reference, in Singapore, we use 6-digit zip codes, each of which can uniquely locate a single building, so yes, a lot of local websites essentially just expect a zip code plus unit number, without the hassle of typing out the address at all. Maybe what I wanted to say is, the idea is cool and _can_ work to enhance user experience with proper localization.
- sevenseacat 7mo ago> If you're asking for a ZIP code, use `inputmode="numeric"` I'm not in the UK and even I know their postal codes have letters in them, cmon mate...
- 1tdimhcsb 7mo ago[dead]
- sjs382 7mo agoThe hubris of buying a domain to loudly demonstrate that you don't understand the complexities of a topic. And then you don't even put your name on it... Anyways, further reading: https://aldavigdis.dev/2023/03/25/falsehoods-programmers-believe-about-addresses-and-location-data/ https://aldavigdis.dev/2023/03/25/falsehoods-programmers-bel... https://github.com/kdeldycke/awesome-falsehood?tab=readme-ov-file#postal-addresses https://github.com/kdeldycke/awesome-falsehood?tab=readme-ov...