What’s in a Name

Are we still having this issue? Will it ever go away? (Yes, and almost certainly no, but one can live in hope.)

Look, it’s very easy to think that names are simple. You have a first name, maybe a middle name or initial, and a last name. Except that it is never that simple. If the data set you’re currently working with happens to be that simple, then you have a ticking time bomb waiting to encounter a perfectly ordinary name that will blow up your code.

I just ran into this one this week. A third party vendor we’re working with (through two removes, and isn’t that a joy) cannot deal with last names that have spaces in them. If you’re the eighth president of the United States, Martin Van Buren, and you try to add your data to this database, it will reject your name. The problem is that the database is trying to separate first and last names into their own fields, but the data being imported has the entire name in one field. So the data import process is using spaces to break up the string into first name and last name. But it can’t tell whether the first name should be Martin Van or if the last name should be Van Buren, or if maybe there is a middle name stuck in there for some reason. (Because, yes, it is also possible for a first name to have a space in it. Really and truly.) And last names can even have multiple spaces.

I would not be at all surprised if this vendor’s system also had problems with names that have apostrophes in them. I feel for the O’Brian’s and the rest of the apostrophe’d of the world, I really do. Hyphens don’t usually cause as much of an issue, but they can.

If your system is foolish enough to track middle names, then you’re going to have to deal with people who have more than one middle name. Two is not at all uncommon. Three isn’t unheard of. Are you going make your users pick just one of their middle names and lose the rest? And have you accounted for people who don’t have any middle name at all? (NMI is a truly ugly middle initial.)

Speaking of not having names, what of the large (yes, very large) number of people who don’t use surnames? I’m not talking about Cher and Bono here. I’m talking about whole communities where it is normal for people to have only one name. (See Indonesia and Iceland.) DO you leave the first name blank? The last name? Can your system handle a blank first or last name?

Now think about the people who use a first initial and go by their middle name instead of using a middle initial. Or a first name that has both a period and a space in it. Really. Names aren’t all Dick and Jane and Smith and Jones, not by a long shot.

If you’ve made an assumption about how long a name should be, there’s a good chance that you’re underestimated. Do your research. If you’re trying to create a good experience for your users and maintain valid data in your database, you don’t want people’s names getting truncated just because they’re longer than you had expected.

We haven’t even gotten to honorifics and suffixes yet, and we’re not going there today. Just be aware that storing and displaying names, especially when moving them from one system to another, is not as easy as you might think.

Leave a comment