top | item 25343112

A package for presenting person names

12 points| robinvdvleuten | 5 years ago |robinvdvleuten.nl

19 comments

order

kevincox|5 years ago

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.

dusted|5 years ago

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]

Rygian|5 years ago

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]

[1] https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-...

kevincox|5 years ago

Seeing as it has the following code sample I'm going to guess "not well".

  new PersonName($this->first_name, $this->last_name);
I mean it could be doing silly things like returning an empty last_name but why bother the user with two fields then?

codetrotter|5 years ago

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.

edent|5 years ago

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.

jfk13|5 years ago

...unless "Betty Cass" is a two-word, non-hyphenated surname. Yes, they also exist.

rurban|5 years ago

Already failing for East Asian names. They must start with the family name, but there's no input field for East Asian. So full is wrong.

sharpercoder|5 years ago

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.

robinvdvleuten|5 years ago

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.

mdpm|5 years ago

First names are not given names. Family names are not last names.

Given names are not familiar names. Given and family names are not legal names.

Please do not use 'abstractions' this broken. The appearance of patterns you're trying to abstract here are cultural windows, not global truths.

corrigible|5 years ago

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

dusted|5 years ago

Ah, you poor guy, Francis Umar Cabbage Knight, your name is offensive because the machine.

fortran77|5 years ago

I always thought his full name was David Heinemeier Hansson Jingleheimer Schmidt.