3 ms·
> treat people's names as a potentially very long and entirely arbitrary text field The problem is that you still need to deal with unicode attacks, sql attack
by Alex3917 8y ago
> treat people's names as a potentially very long and entirely arbitrary text field
The problem is that you still need to deal with unicode attacks, sql attacks, js attacks, css attacks, regex attacks, etc. There's nothing 'arbitrary' about sanitizing any user-inputted text field, and it's especially difficult to do so a culturally sensitive way.
It's a good problem you're solving though. It's a great job interview question to have people write some code and talk through, since to get someone's first name given their full name it takes maybe 20 minutes to write something that works 99% of the time, but then to write something that works 99.99% of the time it takes maybe 20 years.
- tomp 8y ago> since to get someone's first name given their full name I never understood why that's necessary in the first place. Simply have inputs called "full name" and "address" and let people type in whatever, similar to how many websites now have "name" and "title" (as in Mr, Mrs, Reverend, ...), which is a partial and culturally insensitive solution to a similar problem.
- rectangletangle 8y agoThe biggest problem with this strategy is it isn't idiomatic to refer to someone by their full name in many contexts. However given its simplicity, and cultural neutrality, a single full name field should be the default choice IMO.
- setr 8y agoFull name: Nickname: and then refer to them by their nickname, which can be whatever they like to be called, in whatever land they come from and no programmer has to care about human naming conventions ever again
- Alex3917 8y agoEvery extra field on your signup form massively reduces conversion. Otherwise everyone would just do this.
- jdormit 8y agoIsn't that a solved problem? Email and password to sign up, everything else after they've bought.
- ska 8y agoeven better: "Preferred form of address" or whatever, as nickname has a very informal connotation.
- deleted 8y ago[deleted]
- rectangletangle 8y agoThis is basically what Alphanym does, though it presents the nickname field conditionally, to optimize the sign up flow for fewer fields whenever possible.
- db48x 8y agoIf you have sanitize the name field because then you're doing everything wrong. Nothing should break no matter what characters a user puts in their name. Even if they use punctuation or null bytes or control characters.
- Alex3917 8y ago> If you have sanitize the name field because then you're doing everything wrong. If you don’t write software under the assumption that every other developer and all your users are at best wildly incompetent and at worst outright malicious then you’re doing everything wrong.