6 ms·
After reading the Falsehoods Programmers Believe About Names, I wonder, what would you recommend as a universal way to store users's names? There seems to be t
by Tajnymag 6y ago
After reading the Falsehoods Programmers Believe About Names, I wonder, what would you recommend as a universal way to store users's names?
There seems to be two main options:
Store the name in a single field, be correct but lose the option to sort the names reliably.
Store the name in two fields, have the users bend over our western form standards but be able to search and sort easily.
Do you have any real life experience with these or other "falsehoods"?
- dmitriid 6y agoIf you work for a very specific market, provide a canonical way to input the names, but be very very lenient to omissions or extra information. For example, in official Russian documents it's Surname-Name-Patronimic. Which will of course break for immigrants, asylum seekers, foreigners etc. But you can still provide (and store) the names in that order, but let people omit any/all of the fields (and make sure they accept ridiculously long names as well). Outside of government/finanical forms there's rarely a need to worry about 100% correct sorting of names. So go just for one text field, and let people fill it out however they want.
- Muromec 6y ago>For example, in official Russian documents it's Surname-Name-Patronimic. Which will of course break for immigrants, asylum seekers, foreigners etc How does it break? Wouldn't government just form patronimic from fathers name and call it a day?
- dmitriid 6y agoThat's how it's usually solved, and it's a very awkward workaround: - there are cases when the father isn't known. Or even the surname isn't known (people dealing with asylum seekers run into these issues all the time) - Foreign names are not easily converted to patronymics. Russian has adapted Russian names to this scheme: Ivan —> Ivánovich, Vasily -> Vasilevich, Ilya -> Ilyich (note the suffixes -[ov]ich, -[ev]ich, -[]ich). Once you get foreign names, this becomes weird even with European names, and they are often related to a degree to Russian names. Asian names become weird to the extreme, especially with names like Hui which are a cuss word in Russian [1] John -> Johnovich may work, but Huich will not :) - People born to/raised by two mothers will not have a patronymic. There are cases even now when people give their kids a matronymic, but that is a battle against bureaucracy. - And this goes beyond just patronymics. There will be people who don't have a surname. Or the name/surname will include numbers which are not allowed in Russian, but are common in English (John Smith the Third etc.). But by no I'm just reiterating the falsehoods :) [1] https://en.wiktionary.org/wiki/хуй https://en.wiktionary.org/wiki/хуй
- Muromec 6y ago>Once you get foreign names, this becomes weird even with European names, and they are often related to a degree to Russian names. Asian names become weird to the extreme, especially with names like Hui which are a cuss word in Russian [1] John -> Johnovich may work, but Huich will not :) In this case registry official simply starts writing random shit into the system and it becomes your problem. At least that's how it was with "not so Russian names" in USSR times -- just write whatever Russian name that starts with same letter.
- Uberphallus 6y ago> Once you get foreign names, this becomes weird even with European names Wait until you think about multi-heritage names. My son is Spanish AND Ukrainian. Ukrainian naming customs are like Russian, then in Spanish you have two last names. This breaks down as follows: in Spanish the second last name is that of the mom, but in slavic naming customs it changes according to the gender. So in Spain he won't have the last name of the mother, and in Ukraine his last name doesn't match mine. So he's finally name+last name+second last name for Spain, name + ugly patronymic + long ass, unique in the world last name for Ukraine. And in both cases, the name is invariably pronounced wrong, as Spanish doesn't have the Ukrainian и sound, and Ukrainian doesn't have the Spanish z sound. Even for us the parents it doesn't come naturally to pronounce it, so it's not like we can get offended by that.
- Muromec 6y ago>So he's finally name+last name+second last name for Spain, name + ugly patronymic + long ass, unique in the world last name for Ukraine. Oh, dealing with authorities should be fun. Last time I had been there reissuing passport for my son, ДМС officials suddenly realized, that his patronymic is somehow present in a demographic registry without being present in any primary records (birth cert, translations, applications etc). Then they spent solid 30 minutes trying to find nonexistent number of said birth certificate.
- Uberphallus 6y agoYeah, on top he was born in France, and the consular services of either country basically say, "he'll have the name French authorities let you write"; plus patronymic, if wanted, in case of Ukraine. Luckily we had a public servant that was familiar with naming conventions of both countries and his name is the one his mom and I agreed respected both naming conventions the most.
- _petronius 6y agoI think instead of trying to break names apart from one input, the best strategy is to consider the various uses you need and provide that many inputs (in a previous job writing software for art galleries, this was our solution). So for example, you might have a "display name" field, which is the formal name-of-record that you need for any official or semi-official context (title card of an artwork, or invoice info, going on the art example). For indexing/sorting, you can have that as a separate "index" or "sort value" field (especially where sorting is something you want to control on a per-entry basis, like the library example in one of the articles sorting names using the indexing rule of the author's place of origin, or you want to sort a list of names that contain a mix of character sets). For addressing people directly, e.g. via email or letter, you can provide them with an extra "how should we address you" field -- the best part about this is it means you don't have to guess how they want to be addressed, and is I think the most polite option, especially when you're dealing with a variety of cultural contexts in the same system.
- mikequinlan 6y agoYou should store the information that you actually need for your use cases. https://www.w3.org/International/questions/qa-personal-names https://www.w3.org/International/questions/qa-personal-names
- kube-system 6y agoThe only hard part is understanding the use cases before you start collecting data.
- bloak 6y agoTypically you need several independent name fields because people may use different versions of their name, or entirely different names, in different contexts.
- Muromec 6y ago> what would you recommend as a universal way to store users's names? It's unsolvable problem. Names are locale and context dependent and there is no way to translate any given name from it's canonical form (which is nonexistent) to any context you would need (except identity function obv). So you store in-context representation(s) of name and don't transform ever. In practice that means you have one or two fields with no validation whatsoever and let user decide what to enter (while indicating what context it is!), or you apply whatever arbitrary limitation already present in system(s) you interface with. Which usually boils down do "bend over our western form standards".
- nullsense 6y agoLet's just rename everyone a GUID and be done with it.
- Muromec 6y agoAnd pronounce it in NATO alphabet.
- contingencies 6y agoNovember oscar.
- nullsense 6y agoI hereforth shall be known as: Four Five Nine Alpha Six Five Bravo Foxtrot -Bravo Alpha Alpha Eight -Four Delta Five Eight -Nine Nine Five Five -Two Six Delta Echo Seven Five Charlie Five Four Zero Five Seven
- 0xffff2 6y agoDon't forget to enunciate properly on the phone: Four Fife Niner Alfa Six Fife Bravo Foxtrot Bravo Alfa Alfa Eight Four Delta Fife Niner Niner Fife Fife Two Six Delta Echo Seven Fife Charlie Fife Four Fife Seven
- 6y ago
- nullsense 6y ago>Store the name in two fields, have the users bend over our western form standards but be able to search and sort easily. You can't search and sort easily if the names are stored in Japanese. You need 4 fields for that. Edit: now that I think about it I could think of a disgustingly hacky way to squash them into 2 fields and retain those properties, and by extension into a single field and retain those properties.
- shawnz 6y agoWhy would you need 4 fields?
- nullsense 6y agoTo store the furigana for the given name and family name to allow you to correctly perform sort operations.
- shawnz 6y agoDisclaimer: I know very little about Japanese How could you store that in a separate field from the name? Don't the characters in the furigana need to be matched up in a certain way with the characters in the name? It seems like storing the characters in line in the same field as the name would actually be the more correct thing to do here, using a system like Unicode's interlinear annotation characters for ruby text.
- nullsense 6y agoWhere you use each field and what you use it for depends on the context. The furigana can be used for search, sorting or display. It's most useful stored separately. It's also not necessary to display it nicely with the ruby text as it's just a name, so dump it anywhere on the screen where someone can find it is good enough. Furigana displayed with Ruby text is useful as a reading aide in proper passages of text, usually reserved for rare words one is not expected to know and/or as a guide for children in texts aimed at younger readers. You have to put yourself in the position of an overworked, underpaid call center worker with a CRM in front of the who has just been phoned up by a customer called Junko and they are now tasked with locating which record in the system belongs to this customer. You see, there are something on the order of 4 or 5 different representations of this name in Kanji. If you weren't able to search by Furigana the call center staff would have to enquire which kanji it's made up of and then receive a verbal description of the radicals the kanji is composed of and in what order. Now once they're able to find all of the "Junko"s in the system they need to narrow it down. If they were simply presented a fullname with no furigana they might well run into the prickly problem of not actually being able to read the rest of the name. At which point the conversation gets awkward again.
- unnouinceput 6y agoI've dealt with that on a project for Kuwait embassy. The solution was to create a 2 fields (columns) in a separate table that was linked by ID to main "users" table and the UI would ask the user to add whatever wanted and name the field. Then when searching the algorithm would categorize the most used ones and present them from time to time to Admin that would manually add as options for general search UI. As times passed on and more data was entered this way became better and better allowing for a more fine tuning of searchable data. I shit you not, there were fields added there that our Western thinking would never dream they are needed, for example plenty of old people from Papua New Guinea added "Grandfather initial" to their name. Or others added "tribe name" as a meaning to somehow show that they are part of an extended family.
- dcminter 6y agoThat's fascinating. If you were to write a longer form article on this project I'd love to read it.
- unnouinceput 6y agoNot my style. You could read my past comments here on HN and see for yourself my different stories on different subjects, both good or bad (I can't please everyone, not that I try anyway).
- 0xffff2 6y agoI too would love to read more about this. It sounds like a great general purpose solution. Are there any mandatory parts? Assuming not, how does sorting work? Was it a matter of sort orders being pre-programmed for more common fields (e.g. sort by last name first, then by first name) and an assumption that any name that didn't include any of the pre-programmed parts was just stuck at the end? Was it even an issue? (i.e. how many people even had a name consisting entirely of "uncommon" fields?) Edit: Another question. You said just two fields in the secondary table (perhaps you where simplifying though...). How does display work? Presumably the user expects their grandfather's middle initial to be printed in a particular location relative to all of the other parts of their name.
- tannhaeuser 6y agoThere's the UPU S1 standard for that (also covering postal addressing data).
- 0xffff2 6y agoFun fact, this comment is the first result and only result containing all terms when Googling "UPU S1 standard". The closest relevant looking result I was able to find was the "UPU S10 standard", which doesn't seem relevant.
- tannhaeuser 6y agoOops, it's called S42-1.
- rsynnott 6y agoStore in one field. Have a secondary field `order_name` or similar, and make a best-effort attempt at extracting the proper part of the name to order on at save time (I believe there are libraries that can help with this).
- liability 6y agoSerious question, what is the purpose of sorting names? I presume you never give your customers a list of other customers, so such a sort couldn't be useful to them. Is it for internal reports or something? Some MBA says "get me a list of all our customers... and make sure it's sorted!" ? And is some arbitrary imperfect sorting order not adequate for this sorting need? Why not just treat the name field as a bunch of bytes and sort it with no special consideration given to the quirks of names?
- astura 6y agoOne stupid example off the top of my head: A teacher that needs a list of all the students scheduled to be in their 5:00 class. There's literally millions of similar examples. Software where none of the users know about the other users would be fairly rare in my world (I've worked on internal business tools most of my career).
- liability 6y agoIs any arbitrary imperfect sort not adaquate for roll call? If the full names are sorted naively like any other string, why would that be a problem for teachers? I don't get this. Usually what happens is last names are placed first for sorted lists, but this seems like an arbitrary meaningless convention without real utility. And since this arbitrary convention is problematic in cases where names can take on many forms, it makes sense to disregard the convention. If you're not already accustomed to the convention it doesn't even make rational sense; why should the first name be last and the last name first? That's totally backwards, but it's convention. Why though? It's not even like that ordering will necessarily put siblings next to each other on the sorted list. Many siblings have different last names and many people who aren't siblings have the same last name, so what is the actual purpose of supporting this convention? My name is such a convention-defying name by the way, the way I use it. Often I have to enter "[first initial] [middle name]" as my ''first name'' even though it isn't. Just give me a single name field please. Edit: Annoying example from a minute ago: I gave my first initial/middle name to newegg. Newegg tried to be clever by dropping my middle name and now calls me simply "J." That's not my name!