Put the ZIP code first.

It's 2026. A ZIP code is 5 characters. From those 5 characters you get city, state, and country. 3 fields. Autofilled. Put it first, you animals.

@tg This just straight up automatically hits at least two of these incorrect assumptions. The biggest one is there's vast swaths of the western US that have no ZIP code. Also, ZIP codes correspond to postal routes, not cities: 97229 covers Portland, Beaverton, Aloha and Bethany in Oregon. And that's just on one street!

https://www.mjt.me.uk/posts/falsehoods-programmers-believe-about-addresses/

Falsehoods programmers believe about addresses

@BalooUriza @tg I came here to say this, it’s a nice idea but it straight up doesn’t work and can’t be adjusted when it doesn’t. I’m not in the US and it doesn’t even run the query on my input.

@bnut Don't get me wrong, still put the ZIP first, but _only_ to ballpark things. It shouldn't fail just because someone changes the city, state, county, province or country. Could be improved further by putting the country first, then the ZIP. That _probably_ covers all bases unless there's some stateless addresses I'm oblivious to.

@tg

@BalooUriza @tg I think you could put the zip first, then country, and filter every field’s suggested values based on the previously entered data. That minimises typing. Although importantly: don’t assume those suggestions are sufficient and allow manual entry.

@bnut Where my thinking's at on putting the country first is that it narrows down the assumptions somewhat, since that immediately narrows down if postcodes are numeric, alphabetic, or alphanumeric, and how long. Especially since I know that the US is *bizarre* in that our postcodes correspond to postal routes, not geographically compact areas, and having both 5 and 9 digit ZIPs.

@tg

@BalooUriza yeah, I get it, but the post code is still less typing (if you have one).

In theory entering any field first is fine, just some are better than others. For example, if you put suburb first then 新宿区 is probably going to narrow down the countries to one option.

@bnut No such luck in the US, which has 19,495 cities and (only a slight exaggeration) 350 place names between them. Canada has similar issues on a smaller scale for similar reasons.