Not everyone has a surname

Created: March 14, 2018 Updated: Oct. 1, 2026

Store a phone number in a numeric field, and 007, 07 and 7 all become the same seven, because a number doesn't remember leading zeros, and in a phone number that zero can be part of it.

We're working on normalising phone numbers at the moment, that is bringing them all into one tidy format. Sounds simple, strip the spaces and dashes, add the country code and done, but along the way the conversation turned to things programmers believe that aren't quite true.

While we were discussing how to do it properly, a colleague brought up the awesome-falsehood repository, where someone has collected dozens of “Falsehoods Programmers Believe About…” lists, about names, time, addresses, e-mails and, yes, phone numbers. The whole genre started with Patrick McKenzie's 2010 post about names, and more and more fields were added after that.

The very first list can surprise you: not everyone has a surname, not everyone has exactly one full name they go by, names change, and they can't always be written in ASCII, or even in any single character set.

For phones, in the document from Google's libphonenumber repository, Falsehoods Programmers Believe About Phone Numbers, two things were enough for me. The calling code +1 isn't one country, it's shared by the US, Canada and several Caribbean islands, and a phone number isn't a number at all. Put it in a numeric field and you lose the leading zero, while in Italy that zero is dialled even from abroad, so without it you simply get a different number.

Addresses are even more fun. In England there's a house numbered Minusone, in one building in Palo Alto flats 1 and 001 were on different floors, and in Boston Ten Post Office Square is reportedly not the same as 10 Post Office Square.

And the list about time reads like the author arguing with himself. A day doesn't always have 24 hours, a minute on the system clock doesn't have to last as long as on other clocks, fine, almost as long, but surely never more than an hour? You can't be serious.

I'm putting the link here for the record, it'll come in handy the next time some form field seems obvious to me :-)

#dane #normalizacja #ciekawostki

Machine-translated from Polish (original).