Wandering Thoughts archives

2023-08-11

Some problems with 'first name' and 'last name' fields in data

Over on the Fediverse, I said something:

This is my sad face that here in AD 2023, there are greenfield projects using 'first name' and 'last name' fields instead of 'given name'.

(My use of 'given name' is a bit ambiguous here; you might say 'normal name', or just 'name'.)

Patrick McKenzie's justly famous Falsehoods Programmers Believe About Names is the obvious starting point for people who are new to these issues in general, but it doesn't entirely explain all of the specific problems with asking for 'first' and 'last' names.

First off, not everyone has only two names plus possibly an unimportant 'middle' name that you can omit without them caring too much. Some people may have more than two or three names, all of which are important, and some people may not have two names. Providing only two fields forces people to squeeze their name into those fields, in some split that may or may not work and correspond to what you want.

(I'm going to generously assume that your 'first name' and 'last name' fields allow for names with spaces in them. If they don't, you have even more problems, such as people who have multi-word, non-hyphenated first or last names.)

Second, in many situations these two fields will be composited together as 'firstname lastname', and sometimes 'lastname' will be used on its own as a more formal sounding way of talking about you. However, not all cultures write their family names last (or use them alone as more formal forms of address); one not uncommon case is Japanese names. Implicitly such formatting of these fields conflates 'first name' with 'personal name' and 'last name' with 'family name'. If someone who doesn't fit this mold has to be stuffed into your database, either their name order will be wrong or your interpretation of their name will likely be wrong (because your 'last name' label will have been interpreted literally and been used for the name that should appear last in their normal name).

Sometimes people will say 'but we have to sort names and doing it on the personal (first) name gives bad results for Western names'. Well, I have bad news for you; sorting on what's provided as the 'last name' can also do that, even for Western names, depending on the context and what sort of Western names you're dealing with. If you really have to sort on some order and it can't be the simple name, you need to have an additional 'sort on this name' field.

programming/WhyNotFirstAndLastNameFields written at 22:35:04;


Page tools: See As Normal.
Search:
Login: Password:

This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.