Earlier quoted context omitted.
Most of these issues can be solved by simply providing a "Name" field that accepts Unicode and has a reasonable length. Don't validate it in any way except to require at least one non-whitespace character. Trim any excess whitespace and run the text through a Unicode normalization algorithm. At most, filter out Unicode blocks that can't possibly apply, such as emoji and maths symbols. Done. That covers something like…
I consider breaking the fields up well worth the trade-off of people without a surname having some difficulty with it, because that situation is extremely rare, and the user experience is significantly worse if, e.g., I can't meaningfully sort names because I have no idea if you put your given name first or last, etc. There's also really nothing about JSON that should dictate that you can't handle the name "Null" or…
Falsehoods programmers believe about names – with examples (2018)
91–100 of 115 posts
Re: Falsehoods programmers believe about names – with examples (2018)
#92Earlier quoted context omitted.
Most of these issues can be solved by simply providing a "Name" field that accepts Unicode and has a reasonable length. Don't validate it in any way except to require at least one non-whitespace character. Trim any excess whitespace and run the text through a Unicode normalization algorithm. At most, filter out Unicode blocks that can't possibly apply, such as emoji and maths symbols. Done. That covers something like…
I consider breaking the fields up well worth the trade-off of people without a surname having some difficulty with it, because that situation is extremely rare, and the user experience is significantly worse if, e.g., I can't meaningfully sort names because I have no idea if you put your given name first or last, etc. There's also really nothing about JSON that should dictate that you can't handle the name "Null" or…
It is meaningless to "sort" names across countries. Most languages have their own sort rules, and some languages have multiple sorts depending on the specific usage!
Sorting is almost never what you want.
Are you printing out a phone book onto dead trees? No? Then you do not need to sort names.
Just do substring search, and you've already got a UI that is 10x better than having people flip to 'A', then 'Aa' to get to 'Aaron', etc...
If you're about to say "but I need to define a sort order for a database table key" then you've made another mistake and also not read the article...
Re: Falsehoods programmers believe about names – with examples (2018)
#93Earlier quoted context omitted.
> What do you want me to do about it? When you write code that accepts names, don’t bake in assumptions that violate these falsehoods.
OK, so what I'm asking you is how I am meant to handle names which are characters that are literally impossible to represent with a computer.
Re: Falsehoods programmers believe about names – with examples (2018)
#94Earlier quoted context omitted.
I consider breaking the fields up well worth the trade-off of people without a surname having some difficulty with it, because that situation is extremely rare, and the user experience is significantly worse if, e.g., I can't meaningfully sort names because I have no idea if you put your given name first or last, etc. There's also really nothing about JSON that should dictate that you can't handle the name "Null" or…
Did you read the article? It is meaningless to "sort" names across countries. Most languages have their own sort rules, and some languages have multiple sorts depending on the specific usage! Sorting is almost never what you want. Are you printing out a phone book onto dead trees? No? Then you do not need to sort names. Just do substring search, and you've already got a UI that is 10x better than having people flip t…
That is true. However, it's also obviously true that a sort order that tries to take all of these into account, instead of using the rules of the current user's language, is obviously useless, so I don't understand why you think it's a meaningful objection. Users are surprised and annoyed by an inability to sort names.
Re: Falsehoods programmers believe about names – with examples (2018)
#95The problems arise when you want to do more than just echo the name exactly as entered. Perhaps you want to show only last name in some context - now you assume everyone have a last name, and you are already in trouble.
Of course you can't always get away with treating names as opaque, so this is where you need to be very careful with the assumptions you make. The approach depends on the purpose of registering the name in the first place. For example if the purpose is to identify a person showing showing up to pick up a rental car, you just ask them to enter their name as it is stated on the drivers license. If you want to mail them a letter, ask for the name as it is stated on their mailbox.
There is no one-size-fits-all solution, but instead of worrying about the-artist-formerly-known-as-Prince or tribes communicating only with colored fabric, consider the use case for the name. If you have a web-shop you probably don't have to worry about orphan toddler refugees, but if you write software for hospitals you absolutely have to consider the case where the name is unknown. I'm sure Mr Artist-formerly-known-as-Prince has both a passport, credit card, legal name and drivers license, all with names representable as Unicode characters. The question is which one your application needs.
Btw. I find it amusing when web startups think they need a "web scale" distributed database system in order to be scalable to a billion users, but thinks handling characters outside of the ASCII-range is an obscure edge case which can be ignored.
Re: Falsehoods programmers believe about names – with examples (2018)
#96Programmers need to learn from bureaucrats of the 19th century. When bookkeeping of the people truly became a thing in the 1800s, industrialised nations sent out bureaucrats to collect the names of people in villages. Unfortunately, people seldom had enough names to fill in the forms the bureaucrats had. The idea of a family name was not something bestowed to nor necessary for a lowborn. If you're the only Jack in to…
Re: Falsehoods programmers believe about names – with examples (2018)
#97Gotcha. Un-validated unicode text boxes for names in forms from now on. After all, someone could be named like the contents of a 64MB binary blob. Compromises are unavoidable in web development.
You probably need a length limit to prevent against attacks though. Just don't set it at 31 character.
Re: Falsehoods programmers believe about names – with examples (2018)
#98Re: Falsehoods programmers believe about names – with examples (2018)
#99Russians don't hold a patent on Cyrillic. There are plenty of languages using Cyrillic, e.g. Mongolian or Serbian.
Re: Falsehoods programmers believe about names – with examples (2018)
#100Gotcha. Un-validated unicode text boxes for names in forms from now on. After all, someone could be named like the contents of a 64MB binary blob. Compromises are unavoidable in web development.
Unicode text boxes with no validation other than a (generous) length limit and unicode validation is exactly the right approach. Arbitrary assumptions and limitations littered throughout the code is not.