DEV Community

Carly Ho 🌈
Carly Ho 🌈

Posted on

What's in a name (validation)?

This article was adapted from my talk at AlterConf Chicago 2017, which has also been adapted into a handy zine version!

Validating Names

Let’s talk about names!

See how my name’s right at the top of this thing? Names are generally one of the first things we ask for and one of the first things we offer in conversation as part of getting to know someone.

Names are also a pretty personal thing. It’s one thing to dislike your own name for your own reasons, but having someone else mangle your name can range from annoying to genuinely hurtful. So, it’s important to think about how we validate names as we work to create more inclusive technology.

So names are pretty important information. However: names can take a lot of forms, and it's hard to account for all of them. If we want to build validation into our forms, how do we validate names? Can we?

What is a name?

What are things that you’ve seen forms assume about how a name should be formatted?

Some assumptions:

  • Everyone has one first name and one last name.
  • Everyone has one first name and two last names!
  • A name has a minimum of three characters. - you'd be surprised how often this comes up. Hilariously some of them accept "Ho!" and not "Ho"
  • A given name comes first, and a family name comes last.
  • Names are composed of letters.
  • Names are composed of letters from the Latin alphabet, or can be losslessly translated into letters from the Latin alphabet.
  • Names don't change, or only change at a few very specific points in time.
  • Everyone has one canonical full name.

These are all actually wrong! As it turns out, basically all assumptions you can make about names are wrong.

So what IS a name, actually?

What people take for granted as being a "name" anywhere is not true in the majority of other places—and even within their own country.

In the USA, we still often assume western euro norms

While the USA is extremely diverse, there still tends to be a lot of expectation that names conform to a certain "Americanized" standard

This goes back to way before web forms--immigrants did and still do often adopt more "American" names in hopes that assimilating would lead to more opportunity. People with names that don't sound European even today often find themselves marked as perpetual foreigners, even when they were born here, and their parents were born here, and so on.

These expectations, when extended to web forms, both are really obnoxious and do cause problems. I actually was looking into pitching a different talk to another conference earlier this year, but it turned out their form validated names to be a minimum of three characters. To their credit, they were very graceful and fixed the problem after I let them know, but it's possible other people just gave up. (Hilariously, I have occasionally gotten around forms set up like that by adding an exclamation point.)

Names: a way to refer to someone.

That's pretty much it. It's very difficult to define a name as anything other than this very basic, very vague thing, without any incorrect premises.

Sorry, there's no good way to validate them!

So what can you do?

So, okay. Names are nigh-impossible to pin down, but you want to make sure you have data that's useful and serves the intended purpose. What can you do about that?

What do you need the name for?

So, when we're gathering name information via a web form, the point of a validation is not actually to figure out what is and isn't a name; the point is actually to get the information we need to use elsewhere. Sometimes we just want to be able to greet a user in emails or on their dashboard, sometimes we need it to respond to a personal communication, sometimes we need to know what to put on a packing label, and so on.

Do you need to ID them by name?

Do you really need to identify a user by a name? If the information isn't used in any way other than cosmetically, and you have other ways of identifying a user uniquely, such as email, you might be able to just drop it.

Do you need to separate first name/last name?

If there's never any reason for you to need only the given name or names, or only the surname or surnames, you can replace first name/last name with a single full name field. That way people can enter their name in a way that feels right to them.

Do you only need one part of a name?

Like, just the personal name, or just the surname(s)? If so, consider collecting only that data, and labeling it in a way that makes sense to users from any cultural context, such as: "How should we address you?" "What's your full formal title?" or something similar.

Let the user help you by telling them what you'll use the name for

If a user knows you want a name for how to address them in emails, or for addressing a petition to a Congressperson, or to mail them a package, that's useful context that will help the user enter information that's helpful to both of you.

If you know, for example, that some of your users have multiple names that they go by (e.g., some people adopt an "English" given name on immigrating, or to do business with English-speakers, but retain a different legal name), your form might need to ask for both of those names if you anticipate situations where both are needed.

Don't assume which part is the surname/family name

Some people have multiple given names, multiple surnames, or additional name parts that signify gender, generation, marital status or religious identity, among other things.

The world is also not uniform on whether the given name or the family name is written first. For example, many people with Spanish names coming to the United States encounter the issue that only their second family name gets read as their "real" surname, whereas in most Spanish-speaking countries the first one is generally the emphasized one.

Make sure your ui accommodates both long + short names

Twitter, for example, only allows a 16-character display name, which is not much! While it means they don't have to adjust their placement of items in their UI, it means that a large number of people can't enter their whole name on Twitter.

Compassionate Validation

Your system might not be able to process all possible names

Some systems are old, and have limited ability to be changed to accommodate larger character sets, spaces, punctuation, etc. due to the size or sensitivity of the data. That's understandable. I think we're all familiar with airline systems, for example, which stubbornly refuse to process hyphens and tend to squeeze out spaces.

Don't position it as a problem with the user's name

If you can't process a name as-entered in your system, don't position it as a problem with the user's name.

John Graham-Cumming wrote in a 2010 blog post about encountering this issue: "What they actually meant is: our web site will not accept that hyphen in your last name. But do they say that? No, of course not. They decide to shove in my face the claim that there's something wrong with my name." If it's their name, it can't be invalid.

Admit the system limitation in validations + work to improve

The best thing you can do is admit the system limitations in your validation messages (Graham-Cumming suggests "Our system is unable to process last names that contain non-letters, please replace them with spaces", for example) and continue to work on any improvements you can make so that more names can be correctly processed.

Further Reading

Top comments (8)

Collapse
 
david_j_eddy profile image
David J Eddy

Yet another example where the perfect work of math (computers) collides in a very frustrating way with the real world.

Maybe Computerphile could do a video about human names the same way they did for timezones.

Collapse
 
arxeiss profile image
Pavel Kutáč

Thanks for nice article. It is fully true. And now I have to review my forms again.

Just want to share something I bothered with names.
I made a system - and yes, there is First name and Last name field. Because parents are putting there their kids names. And we want to have a list, where Given name is first. For easier usage later.

But some parents are putting there names with CAPS LOCK ON. Not sure why, maybe because it will yell to others, so instructors will notice their kids in the list sooner? So list looks like this then: Peter, Hannah, JOHN, Sylvia.

So I used some libraries to manipulate the name and convert to "correct" caps. I believe, there might be names which will be converted wrong. But it works in 99% cases. I don't like that, but I have to do that. If Caps Lock would be used once in thousands, I wouldn't care so much. But in 20 applications, I see it 3 times. And it is horrible.

Collapse
 
junibugs profile image
Junibugs

Thanks for the great article. Would you have any suggestions for single-letter family names? I work in Product and looking to solve this issue in our portal.

I've been researching the topic and found an example of a solution adopted by Brittish Airways: BA does not allow special characters nor single-letter names in the surname field of their booking portal, so they prompt the booker to input their last name twice. Therefore, the user will input "UU" instead of "U".

I'm not convinced that this provides the best user experience so would love to hear your thoughts.

Thanks in advance.

Collapse
 
jess profile image
Jess Lee

Awesome points, Carly. I think it'll be a long ways before we can move away from the first/last name standard, but what are your thoughts on preferred/nickname fields?

Collapse
 
carlymho profile image
Carly Ho 🌈

I think preferred name/nickname/display name fields are a great idea! It's a great way to let people choose how they'd like to be addressed. I personally have a lot of friends who go by nicknames or middle names and so on, so I think also specifying that you can pick something other than your first name to be addressed by is a nice touch, also.

Collapse
 
dmfay profile image
Dian Fay

Gojko Adzic had a good talk about this too:

Some comments may only be visible to logged-in visitors. Sign in to view all comments.