3 ms·
I’m not sure anyone, including the author, considers addressing every one of those to be possible. But they want you to be aware of the assumptions you’re bakin
by mcphage 5y ago
I’m not sure anyone, including the author, considers addressing every one of those to be possible. But they want you to be aware of the assumptions you’re baking into your code, and maybe spend a few moments about which requirements you actually require. What do you think would be a better way of going about it?
- smoldesu 5y ago> What do you think would be a better way of going about it? I suppose it depends on what you're trying to accomplish. This article definitely reads like it's trying to annoy developers to the point of closing the page though, even if it's intentions are relatively agreeable. I'm reminded of the whole 'master vs main' debacle, where this kind of tribalism hit critical mass. There was huge potential for people to have a good discussion about acceptable practices in software development, but we gave it up in lieu of tribalism and us-vs-them politics. As a result, there was way more media blowback than necessary, which lead to a false sense of urgency and a whole lot of bugs. So, I don't know. But I do know that a good discussion doesn't start with 40 theses and a hostage situation.
- jiggawatts 5y agoMost 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 90% of the already pretty obscure corner-cases. The remainder are likely out-of-scope, such as children that have not-yet-been-named. They can't legally sign up for things in most (all?) jurisdictions, so it's not really worth considering in most scenarios. This is already 10,000x better than ascii-only input fields for "Surname" and "Given Name" limited to something like 20 characters each. Where entering "Null" or "O'Neill" throws a HTTP/500 error because JSON is "so simple" that anyone can use it...
- emodendroket 5y agoI 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 "O'Neill." You don't even need special escaping for those.
- wbl 5y agoThere are entire counties with single names.
- lotsofpulp 5y agoWhich ones?
- wbl 5y agoMyanmar and Afghanistan are the most well known.
- jiggawatts 5y agoDid 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 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...
- emodendroket 5y ago> Most languages have their own sort rules, and some languages have multiple sorts depending on the specific usage! 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.