13 comments

[ 2.6 ms ] story [ 48.3 ms ] thread
And its friends:

* Geography: http://wiesmann.codiferes.net/wordpress/?p=15187&lang=en

* Postal Addresses: https://www.mjt.me.uk/posts/falsehoods-programmers-believe-a...

* Time: http://infiniteundo.com/post/25326999628/falsehoods-programm...

There were some HN links that showed up in my searches, but I didn't bother to include them; left as an exercise to thea reader. Similarly, I didn't try to put them in "who got to which first" order; they're alphabetical and all delightful.

For those who need a flexible data model for representing human names the HL7 V3 RIM works pretty well and allows for handling the vast majority of cases covered in this blog post.

http://www.hl7.org/implement/standards/product_brief.cfm?pro...

Basically every person can have zero or more names, each of which is tagged with zero or more types indicating its purpose. Each name can contain zero or more parts (prefix, suffix, family, given) in any order. And any name or name part can also be NULL (distinct from blank) with a specific qualifier to indicate why it is NULL.

That sounds like an infinite amount of fun to try and format for output :-)
The data model doesn't dictate output format, that's up to the application presentation layer. For internationalized applications the output format will likely be different for every locale.
That sound like it's so flexible that the moment you want to actually use it for anything (like show a list of people to someone), you still have to make assumptions (like "everybody has a name") again. It just delays the assuming.
You're going to have at least some non-NULL attributes for every person even if you don't have a name. It would be foolish to design an application that shows a list of people just by name; you need to include some other attributes as well.
This is an example of overthinking and overcomplicating a task and focusing on edge cases. Not even 80-20, more like 99.8-0.02. 40th point perfectly sums it up - an edge case for feral people, slave in Sudan and someone born and left. One thing missing is a name of an alien with a name that can not be put into visual form.
Not just alien. By some reckoning, roughly half of the known human languages have no written form.
I was curious about this; Ethnologue, which seems to be the base reference on this says:

The exact number of unwritten languages is hard to determine. Ethnologue (17th edition) has data to indicate that of the currently listed 7,105 living languages, 3,570 have a developed writing system. We don't always know, however, if the existing writing systems are widely used. That is, while an alphabet may exist there may not be very many people who are literate and actually using the alphabet. We have data to indicate that 696 languages are unwritten. And for the remaining 2,839 languages we have no data. Source: https://www.ethnologue.com/enterprise-faq/how-many-languages...

Also of intrest on the same site is this page: http://www.ethnologue.com/statistics/size which shows the distribution of first-languages by number of speakers. The top 90 languages account for 80% of the world. The bottom 1% of languages ~5765 have a cumulative ~70M speakers.

It's still a made up problem. I'd just say "my target audience is that and that and I don't care about edge cases until they come up". Get's the job done and prevents wasting effort on imaginary problems.
It's not at all an edge case when writing healthcare software.
This reminds me of dealing with dates, in that parsing and outputting the countless conventions is nearly impossible, but more people than realize it can side-step the task entirely.

For instance, most systems that request a name are just asking how to address you on-screen. You can answer that for 99.99% of people with a single unicode string, and for the remaining 0.01% with a drawing if you are so inclined. Sure some people will have no name or multiple names, but these people are still able to respond to the question "what should I call you?". And then, of course, you need to treat what you get back as an unparseable black box, and not use it for anything but to address them.

Or maybe you're making a system that accepts payments that needs to compare names to names on credit cards. In this case what you want still isn't The Complete List of Things You Associate with the Word "Name", but the name that is on their credit card.

Or maybe you're making something that interacts with legal information, in which case you want the name on the specific legal documents you care about.

Or maybe you're making some form of social network, in which case you do want to allow multiple names (if you're being thorough), but you still don't care about parsing those names.

There aren't many instances in which you need to fully parse and understand a variety of naming conventions.