3 ms·
It would be nice to know what assumptions can be made, instead of having an ever increasing list of ones that cannot be made.
by bnegreve 7y ago
It would be nice to know what assumptions can be made, instead of having an ever increasing list of ones that cannot be made.
- closeparen 7y agoNone. The point of "falsehoods programmers believe about..." lists is that "validation" of user attributes is an arrogant and inherently foolish concept, and you shouldn't try.
- colejohnson66 7y agoJust treat every address as an opaque string. I.E. let the user enter whatever they want.
- jcrawfordor 7y agoIn the US, USPS Publication 28 specifies the requirements for an address to be considered valid by USPS. The print version is 220 pages and still allows a dizzying variety of formats. In general only the last line (city state ZIP) is standardized and the format of the rest of the address can take many forms. This makes sense when you consider that the last line is the only part of the address used for most of the routing process, the recipient and delivery address lines are mostly only to be interpreted by the actual letter carrier. However, Pub 28 attempts to standardize the other lines as much as possible in order to facilitate computerized validation of addresses (a requirement to receive bulk mailing rates). Addresses which can't be interpreted may go to the USPS mail recovery center (formerly called the dead letter office, a term that stuck around in Linux mail daemons) for investigation depending on the service. https://pe.usps.com/text/pub28/welcome.htm https://pe.usps.com/text/pub28/welcome.htm And then consider that, on top of all this, while the USPS doesn't like it, just writing the name of a major institution or company on an envelope will still often result in delivery - if it gets to the post office they'll do their best.