9 ms·
> 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
by tasuki 7y ago
> 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!
- CameronNemo 7y agoYou 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.
- ozim 7y agoWait 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 https://en.wikipedia.org/wiki/Tussenvoegsel Though a lot of pages in NL have separate field for it.
- pmontra 7y agoOr 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.
- earthboundkid 7y agoArabic culture will sometimes adopt a name after you have a child as “father of X”. https://en.wikipedia.org/wiki/Kunya_(Arabic) https://en.wikipedia.org/wiki/Kunya_(Arabic)
- DeathArrow 7y agoYes, 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.
- earthboundkid 7y agoIbn 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.
- deleted 7y ago[deleted]
- kbenson 7y agoNo, 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.
- zachsnow 7y ago> 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.”
- kbenson 7y agoIf 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.
- zachsnow 7y agoExactly 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.
- helloiloveyou 7y agoExactly what I meant, the fields CAN contain whitespace. The first_name, last_name is one that I find useful
- derefr 7y agoMy 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.
- earthboundkid 7y agoThis 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.
- catalogia 7y agoMuch 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.
- ozim 7y agoYeah, "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 :)
- Groxx 7y ago+1 for "name", though you may want different fields for different display purposes: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/ https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-...
- clon 7y agoAbsolutely! 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 https://en.wikipedia.org/wiki/Burmese_names
- alharith 7y ago> 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.
- franciscop 7y agoNon-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.
- jayshua 7y agoTo 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.
- thelittleone 7y agoVery 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.
- 1996 7y agoIn 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-fnu/ 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)
- henrikschroder 7y agoIs there a "last name unknown" as well? There's absolutely individuals for which this is true as well.
- zebnyc 7y agoOne 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.
- codr7 7y agoReminds me of little Bobby Tables. https://xkcd.com/327/ https://xkcd.com/327/
- funcDropShadow 7y agoI 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 ;-)
- Macha 7y agoThe 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.
- MR4D 7y ago> 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 https://en.wikipedia.org/wiki/Peachtree_Street
- radihuq 7y agoHopping 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/address https://github.com/Shopify/quilt/tree/master/packages/addres... And corresponding blog post: https://engineering.shopify.com/blogs/engineering/handling-addresses-from-all-around-the-world https://engineering.shopify.com/blogs/engineering/handling-a...
- chrischen 7y agoThis seems like it hits their graphql api. Is this free to use?
- henrikschroder 7y agoScandinavian 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.)
- DeathArrow 7y agoSome 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.
- msaadat 7y agoThis isn't about nicknames, its about cultural differences.
- henrikschroder 7y agoMy 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.
- 7y ago
- gremlinsinc 7y agoWhat 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?
- orange8 7y agoOne 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.
- nobrains 7y agoThe 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.