Discussion
Put the ZIP code first.
throwaway0665: It doesn't take long to type your address. Plus password managers or keyboards often auto fill it. It's not that deep.
petee: 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
diath: 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.
jen20: 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.
zettabomb: Yeah but, the article was specifically saying that you don't need to put in country because you can look it up by ZIP. That's obviously wrong, but apparently not to the author of the website.
mttjj: 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.
ezfe: Legal 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.
justaboutanyone: This failed when I put in an australian postal code.
RASBR89: 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
exmadscientist: Related, 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.
goloroden: 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…
collabs: At that point, should we even show the whole form? Or should we only ask the country first and then based on the answer, decide whether to show a form? That way the form can be different for each country?I think auto full suggestion should be just that -- a suggestion, not validation.
altairprime: [delayed]
fenwick67: Galaxy brain: address should just be a multi-line field
dgeiser13: Some zip codes cover multiple cities.
wenc: [delayed]
lsaferite: Even in the US, once you have a zip and a name the post office can often deliver mislabeled mail. Results my vary by region though.
smallnix: The visit Japan website for faster customs clearing does that. Zip first with auto fill. Very nice: https://www.vjw.digital.go.jp
zettabomb: 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.
conductr: 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
bob1029: Zip code is a very powerful factor from a PII perspective.https://dataprivacylab.org/projects/identifiability/index.ht...
talkvoix: 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
acidburnNSA: Yeah, but autofilling everything down to the neighboring city is still a huge improvement.
loloquwowndueo: 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.
Spooky23: [delayed]
mikehall314: 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?
acidburnNSA: I think they can just skip the zip code entry and enter everything else as usual.
kawsper: A 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.
NicuCalcea: Most British websites work like this website suggest, in that they ask for the postcode first, then give you a dropdown of all the addresses at that postcode.It works great, except my address is for some reason not in whatever databases these websites use. The building number is on the list, but not the individual flats. So I have to put in the postcode, choose something like "My address is not listed", then fill in the form manually. A few times it wasn't even offered as an option.
paulddraper: Flawed 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).
enraged_camel: I 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.
apendleton: 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.
djoldman: 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)
avidiax: Should be titled "Put the Zipcode and country first".Would be simple enough to have someone type the zip or postal code first, then move the countries that are known to have that zip code to the top of the drop down (still in alphabetical order), and all the other countries below that (also in alphabetical order).Leave all the fields editable, i.e. the postal code only suggests, ranks, or prepopulates.Seems like that would handle all the edge cases, including those where a zip code doesn't refer to one and only one city, or where a zip code has changed or been added to a country.
Normal_gaussian: Yeah, post codes are a huge pit of an implementation. Each country has their own way of presenting and formatting them, as well as additional validation rules (e.g. valid postal districts). This should be amazing (and is), but if you maintain such a validator you'll have a continuous stream of bugs where clients were able to make a mistake they shouldn't have been able to (often breaking downstream where it is hard to recover) or where you refuse to accept somebodies very real address and they are very personally upset (rightly so).That said, the obvious solution is <country> <post code> where <country> is prepopulated from geo-ip or browser signals or similar.
pbnjay: Um 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
kawsper: 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 :)
tokyobreakfast: 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.
phippsytech: 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.
nomdep: If you’re going to ask for a country, ask for it first.Zip codes repeat across countries, you know.
petee: Some 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
loloquwowndueo: Le 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?
rishikeshs: 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
esrauch: Yeah 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: There 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.
modeless: > From those 5 characters you can determine the city, the state, and the countryFalse. 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.
spagettnet: If something is more efficient 95% of the time, and as efficient as normal for the rest of the time, its still a good solution.
loloquwowndueo: “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: "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: I did read it.
tokyobreakfast: 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.
Groxx: yeah - I do think zip first to bring matching things to the top of your other dropdowns and lookup results is almost certainly a good idea, but it's very much not an always-match.
macintux: And as others are pointing out, there are zip codes which appear across multiple countries.
ezfe: Street name isn’t auto completed here…
fjfaase: 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.
stavros: 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.
yardstick: Agreed. 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.
n0w: The author seems to have either misunderstood the API they're referencing or are assuming US only addresses. The specific endpoint they're calling seems to be for US specific zip codes.The point stands that this doesn't "just work" for global services.
kylecazar: The weirdest use of AI I've seen thus far was this pre-population of state and city/town based on ZIP -- by way of a Gemini API call with structured outputs. How one knows how to do that without being aware of the simpler, safer way remains a mystery.I was contracted specifically to help with the when/where of LLM's, to be fair.
bicx: 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.
slartibardfast0: 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.
birdsongs: The best times are when US ecommerce sites try to confidently lint foreign addresses, even when they allow shipping there.I've had them tell me I need 5 digits for my postal code in Norway, which uses 4 digits. I selected Norway in the shipping web form.Or when they tell me special characters aren't allowed, yet the "special characters" are just letters in the Norwegian alphabet. My address contains ø. These aren't even unicode, they're in the extended 8 bit ascii set. Why are you linting these!?These happen all the time. Thankfully our postal system recognises this and allows some substitutions (å=aa, ø=oe, æ=ae).
Macha: I remember US based sites insisting I provide them a post code for like a decade before most of my country _had_ post codes.
hyperbovine: I don’t understand either of these arguments. They both appear to reinforce the point made in the article. At worst a zip code contains multiple cities? Voila the city box becomes a dropdown. It’s 2025. JavaScript.
mttjj: Probably not safe to assume my level of knowledge about any subject matter
peyton: ZIP Code (tm) is claimed as a trademark by the US Postal Service. If you don’t have a ZIP Code, why would you put something in the ZIP Code field?
pstuart: Put a postal code first.Include a field for the country that is autofilled via Geolocation API or geoip if that's unavailable.
idlerig: This. I have to fill out a form that requires uses the ZIP code to look up cit(ies) and state, but often has multiple options for county, which I have to look up in a separate tab independently. It's not the huge time saver it should be... unless we start including ZIP+4, but I couldn't even tell you my own address with +4.
kabamo: if there are multiple cities, then just don't auto fillthat way it's faster and easier for 90% (just a guess) and no different for folks that have multiple cities on that zip
billforsternz: 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"
jmull: Autofill seems like a better solution.
iberator: I don't own a post code and permanent residence. It's a pain in the ass to find some local post code whole in rush etc silly idea
rmunn: Because most websites won't have two separate fields for "ZIP code" and "postal code". Even if they knew that ZIP Code is a trademark (I didn't until you mentioned it), they would (wisely) know that putting in two fields would just confuse most people. So they put in one field. Many sites label it as "ZIP code / postal code", but some just label it as "ZIP code". But the intent is clear: put in the multi-digit string that identifies your address, whether your country calls it a ZIP code or a postal code.
pdpi: 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).
pentagrama: 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.
ghostly_s: > 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: Nobody knows their +4 code. You cannot ask for information 90%+ of people won't have.
evrimoztamur: 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.
NicuCalcea: Yup, 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: In the example, you might at least be able to cut down your menu choices to Maine or Mexico.
gmueckl: Only 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.
bell-cot: Make that 1003+ times. At least in my part of the US, even a pretty modest-size city will have multiple zip codes. And zip codes can have zero geographical footprint (meaning street address) - for example, some zip's are just for Post Office Boxes. And a physical address can have an official USPS address & zip of "Middle City", while physically being in (say) Middle Township. And other fun stuff.
Someone1234: The linked article feels like it is going to get linked in a response article titled "Things you don't know about zip codes" in the next 48-hours to a week.
notpushkin: Put country first. Postcode doesn’t make sense without one. Prepopulating one based on location is generally okay, but don’t assume it will always be the same.Or just don’t try to be too clever.
tokyobreakfast: > 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.Funny that the best solution is circa-1997 Netscape level technology, while everyone iterates on how we can make everyone's life worse with even more unnecessary JavaScript.To type an address on a letter, something a 5 year-old could do with a crayon.
gruez: >Make that 1003+ times. At least in my part of the US, even a pretty modest-size city will have multiple zip codes.Is that an issue? Who cares that new york city has 20+ zip codes? Just fill autofill "new york city, new york".>for example, some zip's are just for Post Office Boxes.Again, is it bad except for some joker who wants something sent to an invalid address?
sph: 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!
zackify: 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!
notpushkin: Yeah. But also, are you ready to maintain a postcode to city mapping for every country you have a significant userbase in?
aewens: My brother’s house is in the same boat. Unfortunately, not all ZIP codes exclusively belong to one city.
cozzyd: And boats can move from city to city!
fingerlocks: If asking for the zip first was more common then we quickly learn those four extra digits because the auto fill benefits would be immediately obvious
adeon: I get the vibe that it's more like there's unexpected complexity and it's difficult to be confident you know how zipcodes work with enough detail to make the feature work. And that is just one example of possible complexity.Do zipcodes change for example? Can your drop-down quickly go out-of-date? You'd need a way to manually enter a city so people are able to tell the system an address. Do you want to bother making an auto-updating zipcode feature just for a form?Is it going to confuse people because nobody else has bothered to make this superfancy selection feature thing?Is this USA only? There are postal codes/zipcode-equivalents in other countries.It starts to feel it's likely not worth the time and effort to try to be smart about this particular feature. At least not if I'm imagining this us some generic, universal address web form that is supposed to be usable for USA-sized areas.To me it feels similar to that famous article about what you can and cannot assume about people's names; turns out they can be way more complicated and weird than one might assume.Although maybe zipcodes don't really go that deep in complexity. But on the spot I would not dare to assume they are.
hirvi74: While interesting, it would take me more time to implement and validate this logic, than it would take the user to enter the data.
giancarlostoro: Or if theres a collision dont autofill it. The rest of is will be glad you autofill for us.
karmakaze: 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.
tokyobreakfast: 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.
1970-01-01: 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.
maxk42: Not true. I don't live in a city. A nearby city serves our mail. But that city exists in a separate county. Presuming my city from the ZIP code results in an incorrect city and county lookup and this has lead to multiple problems on legal documents.
jcrawfordor: 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.
angrydev: Autofill
wooptoo: 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.
hirvi74: I have a better idea. How about we just let the users input their own addresses? These days, most browsers autofill addresses anyway.
zwily: I'd be fine if it autofilled one city from the zip code, which for me is always wrong. I can tab to the field and type in the correct city. Don't even need a drop-down with the possible cities. And if I don't fix it, it doesn't really matter for USPS. They just care that the ZIP is correct.
karmakaze: 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.
tokyobreakfast: When they make erroneous assumptions, which they often do, they steal more of your time and effort than it would take without "assistance".
maxk42: The US also has postal codes that map to individual addresses. People just don't know them.
detourdog: 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.
marcellus23: I don't disagree with you generally but does he really claim it does? The entire page only mentions US, near as I can tell.
sph: > From those 5 characters you can determine the city, the state, and the countryAlso there is a country field, but completely useless as you can’t change from USA.
Twey: ZIP+4? I think that's literally enough digits to give every house in the US (about 150,000,000 apparently) its own identifier.
bombcar: Only if there's never more than 10,000 addresses in a single zip code, which means that if you enforce that, you can force a zip code to appear by building enough house
LeoPanthera: 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.
bombcar: A ZIP+4 does not encode all information.Proof: a post office has its own zip code, for PO Boxes.The +4 is the last four digits of the post office box.If the Post Office has more than 10,000 boxes, the +4 will be duplicated.
bsza: Note to self: make a Tampermonkey script to replace every em dash with the text "EM DASH" in red so I can stop wasting my attention on AI-generated ragebait.
thfuran: But addresses aren’t just for sending mail. Location also determines which municipal and state laws apply, so there are contexts where the distinction matters.
fy20: Being from the England is even worse, 'Country' could be any of the following:United KingdomGreat BritainBritainEngland
spongebobstoes: I bet a large majority of Americans have their city and state uniquely identified by their zip codeif it's not unique, a trivial fallback would be to not populate anything, and that's where we are today
scottlamb: Great. 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.
loloquwowndueo: You also suggested I hadn’t read it. “I won't violate the site guidelines by suggesting you didn't read it”. Only you did (saying you won’t say something and then saying it doesn’t really absolve you).I find you rude so I won’t reply to you anymore.
8organicbits: There'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.` ];
loloquwowndueo: Yeah, that was added after the onslaught. I’m in Canada and got the “across the pond” one. Lol.
esrauch: FWIW 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.
axiolite: That happens, and worse. I've lived in multiple areas that have had their zip code changed. Area codes, too, sometime more than once.
awesome_dude: Why?I have a 4 digit postcode, I have to look it up every time I have to fill in an address form for delivery.I've had people screw 1 digit up in that postcode and their items (a laptop in one case) went to the completely wrong city.A code sounds foolproof, until you realise most people don't engage with them for most of their lives - you don't tell the uber driver the zip/post code you are waiting in, and travelling to, nobody does.edit: just to add - Magic numbers are bad. Software engineers know that a number that's undocumented in code is unmaintainable, a zip code is worse.
axiolite: I've implemented it, too, and didn't run into any problems. User inputs the zip code, if there's multiple city matches, they select the correct one from the drop-down (or you auto-complete the city name after they type the first 4 letters).The fact that "A city can also exist in multiple zip codes. And there can be multiple cities with the same name in the same state" is a good point IN FAVOR of asking for the zip code first (NOT to avoid it) because you certainly can't do it the other way round.And if you just leave it to the user to free-type all that info in, you have to verify it after... Users are going to make typos, and the USPS will kick your butt if you don't correct it (and credit card payments won't go through, either). So it may be less work for web-form creators, but pushing the verification down stream just makes it all worse for the company using it.
awesome_dude: > Is this USA only? There are postal codes/zipcode-equivalents in other countries.This is where the real problems start - postcodes exist the world over.Speaking as someone that has dealt with countries that have postcodes, but no states, so it's just Street Address (if applicable) | City (if applicable) | Country | PostcodeInputting a "zip code" first would result in every country being in the drop down.In Australia, addresses too are wild, they should be considered "free form"https://blog.melissa.com/en-au/global-intelligence/australia...Gives this as an example address The Smith Family'Willow Creek' Stationvia WintonQLD 4730