Hacker News new | ask | show | jobs
by dkersten 2407 days ago
Use two fields: name and display name. Anything else will break for someone. In most cases where something asks for my name its really not even necessary and certainly not necessary to split it into first/last/display/friendly etc.
1 comments

This is not sufficient if you’re going to localize to languages other than English. In some languages, proper names get declined like other nouns and thus change spelling in different contexts.
Are there examples where splitting it in First/Last name (or any other split) would help with that? It seems like that would always either be a problem or something to design around while localizing.
It’s fundamentally language specific, so any comprehensive solution is going to need to interface with the localization system. Really, names should be keyed by (user, language, tag) triples, where the localization defines the acceptable tags based on language requirements. For example, a single person may need their name stored as:

  en:disp     Eric
  is:disp:nf  Eiríkur
  is:disp:þf  Eirík
  is:disp:þgf Eiríki
  is:disp:ef  Eiríks
Designing a UI to collect this information is left as an exercise for the reader.
Since asking a user to enter every possible variant is unwieldy and without doing so, the problem is unsolvable, I’ll stick with my original suggestion of using a single field. Yes, some names will break, but far fewer than if first and last names are required.