by wongarsu · 7y ago · 0 comments
In theory that might not cover everything, but I've never been able to come up with a counter example. Schema.org seems to take a very similar approach. Of course assembling that back together is culture dependant and depends on your use case. If you only need a simple name field that's easier.
Even in English the detail view might show George Walker Bush Jr (the legal name as the person might input it), while in the list you have to safe space and revert to George W. Bush. Greeting the person as "Hello George Walker Bush Jr" is silly, you want to say "Hello George" or "Hello Mr. Bush", depending on how formal you want to be.
In languages such as Japanese you might end up generating honorifics on the fly. You can't do that if you can't parse the name.
The only person qualified to say how a name can appropriately be used is the owner of that name. If you need a greeting, ask the user how they would prefer to be addressed. If you need to show their name to others, ask how they would prefer their name to be displayed. If you need their name as understood by some government agency, ask for their name according to that government agency (note: this is not necessarily the same for all agencies; people do not necessarily have one single legal name).
If you don't want to overwhelm the user, you can have a "Display name" or "Legal name" field depending on what is relevant to your application and use that as the default. But you should provide overrides for every case where you are using their name in a different context.
If this sounds complicated, it is because names are complicated. I have seen too many people with names that don't fit the typical pattern of Firstname Lastname (composed solely of ASCII letters) get frustrated with systems that do not support them. I will not ever assume I can know how to manipulate or use someone's name without them needing to tell me. Nor will I assume their name must fit within some predefined character set or length.
- I assume everyone has at least one name (not strictly true, but close enough to true for people using the internet)
- I assume every name can be mapped to unicode (I don't even know how I would fix that assumption)
- I assume all names fit in some fixed length (I give more space than the British passport and more than I can display in most situations)
- Even though I don't assume that people have a first name or that people have a last name I assume everyone has at least one of the two
I find all of these assumptions reasonable, and your scheme of "Display Name" and "Legal Name" shares most of these assumptions, or would share them in any reasonable implementation (You can't allow names that use gigabytes of space, so there will be some length limit, and most implementations will use unicode).
Of course using a name after decomposing it isn't easy. I will concede that asking the user is easier and more reliable, but it does come with drawbacks as well.
* What do you want to be called?
* (for some cases) What is your legal name?
Trying to decide what level of formality and/or honorifics is appropriate in a specific case seems insane. Just let the user decide.
I once worked at an Australian bank that had a massive SQL function, prob 500+ lines long, for getting the salutation right in mailshots. As well as the usual Mr/Mrs/Dr/etc options, it had decades worth of special cases, largely derived from complaints from VIPs.
e.g. Retired navy officers, professors emeritus, former Members of Parliament, archbishops and rabbis, a rather pompous husband of a female Lord Mayor,...