Hacker News new | past | comments | ask | show | jobs | submit login

> Never store firstname and lastname in the same field

I disagree. Why would you want to force the "firstname lastname" pattern on people? What if someone has three names? Or only one? Just use a "name" field!




Scandinavian here, our names don't really fit this pattern very well either.

My last name has an "ö" in it. That doesn't work in 99% of so-called global websites, so I have to transcribe it as "oe" instead, which is just wrong.

My husband has three first names and one last name. However, his actual name is his second first name. If his full name is "A B C D", if you ask him what his name is, he'd say "B D". If you know him you can call him "B", if you don't, you can call him "Mr D" or "Mr B D". Most American companies call him "Mr A" or "Mr A D", which is just wrong.

I have a friend with two first names and two last names, but his second first name is his name, and he prefers his first last name. If his full name is "A B C D", he'd say his name is "B C" if you ask him. Calling him "Mr A" is just wrong, and calling him "Mr A D" is super duper wrong.

(In government systems in our home country, this is of course handled. You can "mark" which first name(s) are preferred, so mail to my husband from either government or private companies will always be correctly addressed to "B D" and nothing else.)


Some people have nicknames and prefer to be called like that. A known singer would prefer to use a sign instead of a name.

People can have thousands of preferences and an app can't account for all, but for the majority of use cases.


My examples aren't about nicknames, they're about the difference between someone's full name, and their name.

And even in American name culture it's not obvious how to transform someone's legal name to their name. How would you encode that the name of "William Henry Gates III" is actually "Bill Gates" ?

"William" - nope.

"Mr III" - no no no.

"Mr William H. G. III" - nooooooooooo.


That was my point: trying to account for every preference an user might have or every particular scenario is too complex and takes much time and human resources. The right thing is to address the majority of your user base.

To take your example, why should my app encode that "William Henry Gates III" is actually "Bill Gates"? I will provide a form with first name and last name and Mr Gates can register as "Bill" "Gates" or "William Henry" "Gates".

I have three given names and I find it a non issue completing forms. And that's because a string can contain white spaces or even be empty so you can encode any arbitrary combination of first name + last name.

Also, people get to much into politics, trying to be "revolutionary" instead of trying to solve the technical issue at hand.

I can solve a technical problem in 2 minutes or get in political phylosophy and argue for 2 years without solving anything and without helping anyone. I rather solve the problem.


Don't dismiss nicknames. In Germany e.g. you can put an artist name on the id card and your pass port.


This isn't about nicknames, its about cultural differences.


Absolutely! Having 'name_given', 'name_middle', 'name_family' or some nonsense like this is one of the most common mistakes in database (and application) design, usually made by culturally narrow-minded Western developers.

Take names in Myanmar [1] as an example. From Wikipedia:

> Burmese names lack the serial structure of most modern names. The Bamars have no customary patronymic or matronymic system and thus there is no surname at all.

That said, it is hard to push back on a business requirement to sort users A-Z based on family name, just because.

[1] https://en.wikipedia.org/wiki/Burmese_names


It’s not really a mistake to localize your application design and UX to the first major market that you are targeting.

To immediately target the entire world, will leave you burning cash as you figure out all 200+ counties customs, or with a hopelessly generic app that is hard to use for everyone, pleases no one, and hard to extend in culturally relevant ways.


This kind of mentality lead to huge fuckup that were the ASCII code-pages, and we are still suffering fallout from that.

I still cannot input one of letters in my name into most systems for example.

There is a decent middle ground, as you can store first-name(or equivalent), last name(or equivalent) for sorting purposes... and a display name which is culture sensitive.


> usually made by culturally narrow-minded Western developers.

Usually made by developers who realize this will suit 99% of their users. I'm culturally eastern myself and realize this.


Non-American here. I believe US citizens often have a middle name. We Spanish-speaking people have 2 last names. Japanese reverse the "firstname" and "lastname". I had a lot of troubles when I tried to buy a ticket in a Chinese website a few years back. So no 99% of the users don't follow the "firstname" and "lastname" pattern. We might put up with it, but it doesn't suit 99% of the users as stated.


To clarify the comment you are replying to (not the author): 99% of their users. Clearly 99% of people globally aren't going to follow that custom, but many (most?) applications written in the US have a user-base where 99% of their users will follow the custom. Switching to something more globally applicable isn't necessarily a non-zero cost either - using a single name field has downsides like making sorting by last name more difficult (a ubiquitous thing in the US) and not being able to display first vs. last name where culturally expected.


But I am replying exactly to that. I don't believe 99% of the users of a given application for any non-trivial number of users conform to have exactly a "firstname" + "lastname".

In the US it's not rare to have a middlename. And there are many Latinos, Japanese and Chinese in the US as well, all of them which do not follow the convention.


A lot of US-based startups target the global market early on, although they behave as if they only had to cater to US users.

As a side note, the group of HN commenters seem to fall into two categories, the first think group of commenters seem to think HN is a mostly US only forum, whereas the second group seems to think HN is an international forum. I don't know what the truth is or whether there is one at all. But I know, that it sometimes irritates me, when commenters or posters assume, that they are talking only to US citizens.


I suspect it's usually accidental but I feel very little rancor towards them. You solve things the way you think about them (until yesterday it wouldn't have ever struck me that a currency symbol could be in the middle of the value). And that's how, I suppose, you end up with a bunch of people with US Visas that say FNU (first name unknown) in front because they only have one name.


That's why you store a "name" field, and then spend the rest of your carrier writing parsing logic to answer silly management questions.


A Burmese here and thanks for pointing out! I have to explain to other people that we don't follow the father's name most of the time. Some names the father's name at the end. e.g if my father name is Myint Swe, my name could be Ko Ko Myint Swe.


It is typical to sort such things in multiple columns. You just need to decide if people with no last name sort first or last.


+1 for "name", though you may want different fields for different display purposes: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-...


The same also applies for the structured address format. I've seen some stupid decisions in the name of this.

Post codes: 5 years ago, my country brought in post codes. prior to this there were none. It was not for the benefit of our postal system, who stated they didn't really care, but for badly designed web forms (and the occasional rural house with an unhelpful address)

They also may not fit your convention of what addresses in your country are. The obvious examples are stuff like Japan and one or two central European cities that are addressed "Building number, Block Number, City", but the aforementioned unhelpful rural addresses include a former friend of mine who had to give his address as "House name, near village, County". Actually the village was not near but it got the mail to the right post office which knew what to do with it.

As a counterpoint, I've had places that have very strict fields like "Street Name" (20 char limit), City, County, Country. For a few years I lived on a street who's name appeared three times in the same city. The actual form to get it delivered was "Street name, Locality, City", but because of the length limits I had to sneak the locality into the City field, which luckily worked as the City and County shared a name.


Hopping on the topic of addresses and not completely related to your point - but if anyone's having challenges with handling address fields I'd highly recommend checking out Shopify's address package:

https://github.com/Shopify/quilt/tree/master/packages/addres...

And corresponding blog post:

https://engineering.shopify.com/blogs/engineering/handling-a...


This seems like it hits their graphql api. Is this free to use?


> For a few years I lived on a street who's name appeared three times in the same city

You should try going to Atlanta and finding a business on “Peachtree” street. [0]

[0] - https://en.wikipedia.org/wiki/Peachtree_Street


I agree with everything you mentioned in your post.

That being said:

> For a few years I lived on a street who's[sic] name appeared three times in the same city

This is why you have postcodes ;p


>> For a few years I lived on a street who's[sic] name appeared three times in the same city

> This is why you have postcodes ;p

I guess, but it was foreign vendors which expected "Street Name, Postcode, County". Locals and the postal service were working fine with "Street Name, Locality, County"


Just store GPS coordinates, floor number and apartment number. :D


All fine and dandy until the geography shifts.


Very cool to see mention of "one name only" case. My wife had only one name before we married. She's Indonesian. When we got married in Australia our forms pretty much crashed the Government's Birth's, Death's and Marriages system. We got bounced around between all different people trying to compute the reality that in some parts of the world, people have only one name.


One of my indonesian friends also had only one name. She named herself as Noel as she felt that was better than being referred to as Ms. Null.


I once worked on a project, which used the Dow Jones list of people of interest, a list of politicians and terrorists, mostly. One day the software began to fail catastrophically, when parsing the latest version of that list. That day, a Mr. Null was added to that list ;-)


As in no name at all? Now that’s an entirely new level. Pretty forward thinking parents considering today’s surveillance... maybe they where phreakers tried to name him ' OR '1'='1 but the Government didn’t accept special characters so they resorted to naming him null.

:)


Reminds me of little Bobby Tables.

https://xkcd.com/327/


In the US, she would have been forced to use the infamous "FNU" (first name unknown)

https://uk.usembassy.gov/visas/visa-errors/name-appears-as-f...

because governments prefer not respecting people names and customs, just so they can push their own customs (and in that case their name too, because "FNU" is the 30'000 most popular name in the US now)


Is there a "last name unknown" as well? There's absolutely individuals for which this is true as well.


A family friend had this problem when he immigrated to the UK from India. He just repeated his single name as it was both his forename and his surname.


Yeah, "humble guide..." using never/always in 3 points, seems like author thinks he saw everything but he is up for unpleasant surprise in the future :)


You seem to be assuming that each field:

1. Could not contain whitespace.

2. Would have a minimum length.

TFA specifies neither of these requirements. You could have someone's first name (which I would recommend calling given name) be "Pablo Emilio" and their surname be "Escobar Gaviria". Or alternatively you could have someone with a given name of "Sukarno" and an empty string for the family name. Patronyms and matronyms are sort of ambiguous, but would probably be categorized as surnames.

I use a single name field, but I don't think a given name and surname split is crazy.


My favorite way to do things is to just ask for a "full name"; and then, separately, a "calling name" (i.e. "what do we call you?")

The "full name" is for putting in the c/o part of a mailing address; while the "calling name" is for showing beside your profile picture or for saying "Dear [name]" in a mail-merge.

Neither of these is a nickname. They're both your "real" name. But neither of them are your legal name, either. You're free to make either of them whatever you want, and to make them both entirely unrelated to one-another. They're just two forms of "your name" that you might expect to see in one place or another. And we can ask for them, so that we can then spit them back out at you in the situations that call for them.

Doing things this way skips the entire minefield of "given names", "family names", titles/appellations, etc. You've got use-cases for someone's name? Ask the user directly, for each use-case, what text they'd like to appear. There's not too many use-cases, really; you only need to ask a couple such questions, in the end.


This is the correct answer. The question to ask is, what are you doing with the names? Splitting first and last only makes sense if the thing you’re doing is listing people by last name. Sometimes you do that! But not always and certainly not in all countries.


No, I think GP is assuming that names are very complex, and even the assumption that people have a first and last name isn't always correct. You can just use a name field, and let people supply the name they want to use.

What do you really need a first and last name separated for anyways? Sorting? A salutation on correspondence? Sorting by last name isn't usually important[1], and you can generally use a full name in a salutation.

Depending on the domain needs, you choose the right representation. If you expect US citizens and want their name as entered on their tax returns or social security card, then you match what those can hold and note to the user that you are expecting those values. If you're just collecting a name to have a name, why put an extra constraint in there that doesn't matter?

1: Not to mention you then get to mostly ignore the craziness that is utf-8 and combining characters and cases and sorting.


> What do you really need a first and last name separated for anyways? Sorting?... Sorting by last name isn't usually important...

When paying customers / clients want to sort by last name, because “that’s how we do things”, then you sort by last name. So it’s only important when you want to make money.

Edit to add: your customers also don’t care that someone somewhere has 6 first names and no last name. “This wasn’t a problem with our old software.”


If customers need it, then it's a requirement. Nothing I said indicates you should leave out customer requirements. In fact, I specifically alluded to including separate names in cases where it's needed.

Sometimes the customer is you or your org, and in those cases it may not be a requirement.


Exactly as you say: if customers (that is, the people paying for the software, not necessarily the people filling in forms) need it, then it's a requirement.

The point is that while sorting by last name (say) might not seem important to an engineer, and requiring a last name might seem outright stupid to a person filling in a form, nevertheless it is often an important requirement. Frequently folks will observe some "stupid" form, and link to some "falsehoods engineers believe about X" document, suggesting that engineering "got it wrong", when in fact they have simply misunderstood who the software is actually for.


Wait till you get into some Dutch surnames "van der Kleij", "van den Bosch", "de Jager" which are not patronyms. They would still fit into "first name, last name" pattern. Because you assume what is last name can have https://en.wikipedia.org/wiki/Tussenvoegsel

Though a lot of pages in NL have separate field for it.


Or German ("von Trips") or Italian ("De Sica") and possibly other countries.

Anyway, people who move to other countries have to adapt. For the database of a local business is often a good idea to stick with the format of official documents because everybody has to fill out forms on government websites, regardless where they were born. Ids, taxes, healthcare, schools etc.


Arabic culture will sometimes adopt a name after you have a child as “father of X”. https://en.wikipedia.org/wiki/Kunya_(Arabic)


Yes, Arabs use "Ibn" and jews use "Ben". Slavs use father's name and "ich" suffix. People in Iceland use different kind of patronimics.

You can either use just one name field if your logic doesn't need a name or surname or provide two fields for name and surname and let the user handle the splitting.

I have three first names. When I fill a form, if it's an official form or if it's for business purposes I fill all my names as first name, if not, I only write the name I use.


Ibn is a patronym, but a kunya is the other way: your name is the name of your child. E.g. Palestine’s Abbas is also “Abu Mazen”, the father of Mazen.


Exactly what I meant, the fields CAN contain whitespace. The first_name, last_name is one that I find useful


Much of the official paperwork in my life has "[First Initial] [Middle name]" in the first name field, which works (usually). But why should I have to do that? It's a pain in the ass.


The usual pattern in this case is to add first name and then all rest of the names in the first_name field. And last name in the last name field. Users can be made aware of this on the UI.

Another option is to create a middle_names or other_names field, its first_name then other_names then last_name in that order.


One way to look at it, if you have more than one name, you'll usually have a preferred order of writing them, regardless of culture. The first-name used will have different protocols and meanings in different cultures, but it is still the first-name, literally.


What if you're ordering by 'last name'?

Say it's an HR app. Do you just assume the last word in the name is the last name?




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: