6 ms·
I actually wrote a full-stack web service to handle people's names, specifically to help avoid situations like this. My best advice: treat people's names as a p
by rectangletangle 8y ago
I actually wrote a full-stack web service to handle people's names, specifically to help avoid situations like this. My best advice: treat people's names as a potentially very long and entirely arbitrary text field. Don't assume anything without their confirmation, even if it seems obvious, because somewhere out there someone's name will violate that assumption. My research did conclude that nearly all names are below 500 characters, so that's a reasonable upper bound, though I would at least double it to be safe.
https://www.alphanym.com/demo https://www.alphanym.com/demo
- crooked-v 8y agohttp://www.historyrundown.com/top-5-people-with-the-longest-names/ http://www.historyrundown.com/top-5-people-with-the-longest-... There's a couple of people for you with legal names well past 500 characters, and that's just of Western European descent, where German-style compound words are rare.
- rectangletangle 8y agoMost certainly, percentile wise, they're the 99th. Nearly every case where I encountered a name that long though, there was a shorter form. Generally really long names are either patronymic/matronymic (listing ancestors) like many Arabic names, or names following Hispanic conventions. Hawaiian names can also sometimes be rather impressive. For instance Pablo Picasso's full name is 103 characters (without whitespace): Pablo Diego José Francisco de Paula Juan Nepomuceno María de los Remedios Cipriano de la Santísima Trinidad Ruiz y Picasso
- pvaldes 8y agoIs a thing of the past. In Spain is currently illegal to register a baby with more than two first names, except if she/he belongs to the royal family. The last name's list on the other hand can be technically infinite but only the first two (from both: father and mother) are used normally. You can have also as many pseudonyms as you want of course, but they aren't official names.
- protomyth 8y agoWorked with a guy with a really long set of names. Found out much later that what I thought was his first name (which he went by) was actually the initials of his names before the family name.
- rectangletangle 8y agoThat's a pretty common way for people to modify their names into a more practical form (I'm sure typing all that out is a pain). This is why you shouldn't ever assume properties of people's names, and should instead write UIs which confirm the name's properties with the user. Just for fun, I wrote a quick query to pull the head from my DB. NAME_LENGTH_CHARS, NAME_TEXT 91 'Mary Abigail KawenaʻUlaokalaniahiʻIakaikapoliopelekawahineʻAihonuaināleilehuaapele Wiggin Pukui' 85 'Upatissa Atapattu Bandaranayake Wasala Mudiyanse Ralahamilage Shirani Anshumala Bandaranayake' 83 'Wanisekara Bandaranayake Wasala Mudiyanse Ralahamilage Aluwihare Uda Walauwe Alick Aluwihare' 68 'Guido Georg Friedrich Erdmann Heinrich Adalbert Graf Henckel von Donnersmarck' 66 'Wasalakulathunga Wijekoon Mudiyanselage Duleeka Kumari Wijekoon Marapana' 65 'Clemens Erwein Heinrich Karl Bonaventura Freiherr von und zu Franckenstein' 59 'Guillaume Joseph Hyacinthe Jean-Baptiste Le Gentil de la Galaisière' 58 'Weerasooriya Dissanayake Mudiyanselage Punchi Banda Dissanayake' 56 'Charles de Marguetel de Saint-Denis, seigneur de Saint-Évremond' 56 'Venerable Professor Kollupitiye Mahinda Sangharakkhitha Thera' ... (EDIT TO ADD: These are all names initially sourced from Wikipedia)
- xyzzyz 8y agoDid you really just pull out random people names from your database and posted them online?
- rectangletangle 8y agoNo these are all names of public figures pulled from Wikipedia, not names submitted by individuals, because of the obvious privacy violations. Each name has a corresponding Wikipedia article. I should have clarified initially though. For instance: #1 https://en.wikipedia.org/wiki/Mary_Kawena_Pukui #2 https://en.wikipedia.org/wiki/Shirani_Bandaranayake #3 https://en.wikipedia.org/wiki/Alick_Aluwihare
- userbinator 8y ago#2 and #3 on that list were clearly done as publicity stunts/"testing the limits" Bobby Tables-style than anything occurring naturally.
- imh 8y agoWhat does "naturally" even mean here? Everyone these days seems to be giving their kids unique names. Some people name their kid Obi-wan Kenobi. That's not really any different than these people, is it?
- userbinator 8y agoObi-wan Kenobi isn't all that odd --- to someone unknown to Star Wars, it wouldn't stand out among a list of other foreign-sounding names. On the other hand, an ultra-long name that seems to be designed for testing overflows, in buffers mental or physical, is like a very different category to me.
- 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.
- umanwizard 8y agoEven arbitrary text doesn't cut it -- not all names can be represented in Unicode.
- imh 8y agoSounds interesting. Any examples?
- ConceptJunkie 8y agoThe Artist Formerly Known as Prince
- Alex3917 8y agoOnly around half of all languages even have a writing system.
- telotortium 8y agolanguages with logo graphic writing systems, such as Chinese and Japanese. I think for governmental purposes there is a set of allowed characters, but people may consider the true form of their name to be written with a rare character that's not in unicode.
- rectangletangle 8y agoWhile still in the Unicode realm, some people have names that can only be spelled in their native script vertically. For instance people with Manchu names. This case breaks Wikipedia's formatting in comical ways. https://en.wikipedia.org/wiki/Nurhaci https://en.wikipedia.org/wiki/Nurhaci
- baddox 8y agoBut surely there must be some point where it’s okay to build a software application that expects some sort of personal identification, right? At some point surely it’s okay to cover some vast majority of people’s names and allow the rest of people to type in whatever they want? I don’t really see a problem unless you require a name to conform to some specific format while also having a policy against users using “fake” names.