Live data from Hacker News

A package for presenting person names

robinvdvleuten.nl

1–10 of 20 posts

Re: A package for presenting person names

#3
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.

Re: A package for presenting person names

#4

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.

Re: A package for presenting person names

#7
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...

Re: A package for presenting person names

#8
post #3

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.

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

Re: A package for presenting person names

#9
post #6

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-...

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?
Post reply on HN