Re:75½ Bedford Street
by bnegreve on Wednesday February 26, 2020 @10:34AM
(#22423856)
It would be nice to know what assumptions can be made, instead of having an ever increasing list of ones that cannot be made.
[ Parent
| on HN ]
Re:75½ Bedford Street
by closeparen on Wednesday February 26, 2020 @10:48AM
(#22424011)
None. 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.
Re:75½ Bedford Street
by jcrawfordor on Wednesday February 26, 2020 @05:47PM
(#22428290)
In 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
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.
Re:75½ Bedford Street
by colejohnson66 on Wednesday February 26, 2020 @11:05AM
(#22424197)
Just treat every address as an opaque string. I.E. let the user enter whatever they want.