Trying to derive names is basically an impossible problem. I highly recommend the following both as arbitrary text fields:
1. Ask for "Legal Name" if you need it.
2. Ask "what would you like us to call you?"
If you are displaying users' names to others then you have infinite choices but they all boil down to "what would you like us to show in this context". The simplest is just a global name but you could have different display names towards different users/groups.
This. I can only upvote once, so I did, but this.
There are about two input fields to take a name:
Anything more starts making assumptions, actually, it's an assumption that everyone has one.
Your real name:
Your shown name: [leave empty to use your real name]
I would be interested in seeing a "level of compliance table" of this piece of software (or its Ruby ancestor) against each of the falsehoods programmers believe about names [1]
I think trying to split names into such parts is a losing battle. If you need to split it up ideally I think the user should have a say on how their name is presented.
Is `$name->sorted` incorrect? I would have thought it sorted on family name, not middle name?
For example, "Alice Betty Cass" should be sorted as "Cass, Alice Betty". The example given would sort it as "Betty Cass, Alice". That would only make sense if the surname was double-barrelled. e.g. Alice Betty-Cass.
I'd only use something like this to fill out default name variants, and allow users to edit those variants (or have it be editable by an admin, if you're storing customer names in something that isn't directly customer-facing), considering these: https://duckduckgo.com/?q=falsehoods+programmers+believe+abo...
Interesting that you as a Dutchman did not model Tussenvoegsel, which is unique to Anglosaksian names and in particular Dutch, Belgian and German names. Handling of them is unique within these cultures. It should also not be confused with infix.
You are totally right! But it would make the logic way more complex than it is right now. I have as "tussenvoegsel" already two words, but how to handle also last names containing two words as well.
Most of the time a distinct between first and last name is already enough for presentational purposes.
The simplest solution to storing people's names is a standard character field of reasonable length. Perhaps another one for "legal name" if needed. Maintaining a `tzdata` equivalent for names is a losing battle IMHO
1. Ask for "Legal Name" if you need it.
2. Ask "what would you like us to call you?"
If you are displaying users' names to others then you have infinite choices but they all boil down to "what would you like us to show in this context". The simplest is just a global name but you could have different display names towards different users/groups.