logoalt Hacker News

Normal_gaussianyesterday at 11:53 PM0 repliesview on HN

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.