Avenue de la Sallaz 29
1010 Lausanne
Suisse
1010 is the post code, identifying La Sallaz (or a part of it?), in Lausanne. My point? All this stuff is very local and if you want to do it right you should just ask for addresses free-form and if you need to extract information from it then you should use a geocoding library (e.g. http://geocoder.rubyforge.org/) to normalize it for you.Considering this and all the other issues related to addresses, I really wonder why we are still trying to store them in separated fields.
Why can't the address just be one big multiline text field where the user types whatever would be needed to receive a postal letter? If we need the data in structured form, we could always write a locale-aware parser that extracts the needed information.
Splitting the address in multiple fields (sometimes even labelled address_line_1, address_line_2 and so on) is probably a relic from the times where databases had nothing but CHAR (with a maximum length of 100 or something) and where applications were created for the local market only.
I would need to do some a/b testing, but I really doubt that it'll be easier for a user to fill out the traditional
Street 1: _______________ Street 2: _______________ ZIP: _____ City: _____________
form instead of just one big text field labelled "Postal Address" - personally, I'd probably be WAY faster filling out that one.
A recent client demanded the address be broken out into fields, but I at least swayed them into accepting a big-text-box for "international" addresses after showing them a few examples.
Most countries on Earth are not federations; dozens of nations are small enough that dividing into "provinces" would be meaningless; and even larger countries that do have regions may not include their names in mailing addresses.
260 Broadway
New York 17
New York
but then the 17, originally a numbering system for big cities, became 100-07, the postcode 10007. (Compare the postcodes around London, EC1/N1/SW1/etc, which were originally just for sorting mail around the central city of England.)
Of course it is 9000 and ever since the ZIP code field is a non-validated text field in all applications I have done since :-)