News for hackers. Stuff that matters.
Re:Falsehoods Programmers Believe About Names – With Examples by LordHeini on Friday November 30, 2018 @07:09AM (#18568499)
So what is the solution now?

Have a single full Unicode 'name' field which is over 200 characters long?

What is even the longest possible name?

The ex german minister of defence has 108 characters in his ridiculous name.

Re:Falsehoods Programmers Believe About Names – With Examples by posterboy on Friday November 30, 2018 @07:26AM (#18568580)
Relevant stackexchange answer [1]:

> one second-century consul was named Quintus Pompeius Senecio Roscius Murena Coelius Sextus Iulius Frontinus Silius Decianus Gaius Iulius Eurycles Herculaneus Lucius Vibullius Pius Augustanus Alpinus Bellicius Sollers Iulius Aper Ducenius Proculus Rutilianus Rufinus Silius Valens Valerius Niger Claudius Fuscus Saxa Amyntianus Sosius Priscus.

> The ex german minister of defence

That would be "Dr. Copy Paste" a.k.a. Karl-Theodor Maria Nikolaus Johann Jacob Philipp Franz Joseph Sylvester Buhl-Freiherr von und zu Guttenberg [2].

[1] What linguistic impact, if any, has the the Roman three name naming system left on modern Romance and European languages? https://linguistics.stackexchange.com/a/29277

[2] https://de.m.wikipedia.org/wiki/Karl-Theodor_zu_Guttenberg

Re:Falsehoods Programmers Believe About Names – With Examples by cabalamat on Friday November 30, 2018 @09:39AM (#18569382)
> So what is the solution now?

The solution on Machine-Readable Passport is that everyone has a surname and one or more given names, using only A-Z characters, for a total of 39 characters.

https://en.wikipedia.org/wiki/Machine-readable_passport

Everyone who travels internationally has a name in this format, even if they have other names for other purposes as well.

I would suggest for a lot of software, the name in Machine-Readable Passport format, plus another field "How would you like to be addressed" allowing any unicode characters, would satisfy most requirements.

Re:Falsehoods Programmers Believe About Names – With Examples by isbvhodnvemrwvn on Saturday December 01, 2018 @04:44AM (#18576089)
Now you assume everyone travels internationally (and that assumes they travel with a passport, not necessarily true for instance in the EU), or even remembers how their name was botched by this format.
Re:Falsehoods Programmers Believe About Names – With Examples by cabalamat on Wednesday December 05, 2018 @06:26AM (#18607344)
> Now you assume everyone travels internationally

I'm not making that assumption. I'm saying that in terms of all the directions that name-processing and name-recording software are pulled in, it's a compromise that works for many purposes.

It isn't perfect, and I'm sure some people can come up with edge cases where other data formats might work better.

Re:Falsehoods Programmers Believe About Names – With Examples by gvx on Friday November 30, 2018 @07:35AM (#18568618)
There is no single solution. In terms of complexity required, I would suggest:

- Not having a field, if you don't need it. - Having a single Unicode variable width field for "how would you like us to call you" (so not necessarily a full or formal name), with a maximum length of at least 1K characters. - Having two such fields for "given name" and "full name", with the understanding that neither may match the legal name because of practical limitations. Which field you use depends on the formality required by the specific use.

If your business is related to certain government, healthcare, legal, etc. stuff you'll probably have domain specific requirements, but I could imagine you might need to be able to have several names connected to a single person. One scheme that might be useful in such a situation might be:

- Having a set of (description, name) Unicode string tuples (variable length, generous max length). For example, one might have:

    {("Given name", "John"), ("Birth name", "Vera de la Cruz"), ("Legal name", "John Quincy de la Cruz-Stevens")}
Re:Falsehoods Programmers Believe About Names – With Examples by naravara on Friday November 30, 2018 @11:04AM (#18570015)
>- Not having a field, if you don't need it. - Having a single Unicode variable width field for "how would you like us to call you" (so not necessarily a full or formal name), with a maximum length of at least 1K characters. - Having two such fields for "given name" and "full name", with the understanding that neither may match the legal name because of practical limitations. Which field you use depends on the formality required by the specific use.

I look forward to being in line to check into a hotel room while the clerk tries to puzzle out how to lookup the reservation for a guy whose name is just a string of emoji.

Re:Falsehoods Programmers Believe About Names – With Examples by masklinn on Friday November 30, 2018 @07:47AM (#18568672)
> Have a single 'name' field which is over 200 characters long?

Or, as postgresql calls it, "varchar":

> The storage requirement for a short string (up to 126 bytes) is 1 byte plus the actual string, which includes the space padding in the case of character. Longer strings have 4 bytes of overhead instead of 1. Long strings are compressed by the system automatically, so the physical requirement on disk might be less. Very long values are also stored in background tables so that they do not interfere with rapid access to shorter column values. In any case, the longest possible character string that can be stored is about 1 GB.

Re:Falsehoods Programmers Believe About Names – With Examples by JessicaTG on Friday November 30, 2018 @07:52AM (#18568701)
Or just use "text" :-)

There's no storage advantage using varchar in PostgreSQL. Just the length constraint checking.

Re:Falsehoods Programmers Believe About Names – With Examples by masklinn on Friday November 30, 2018 @08:08AM (#18568771)
> There's no storage advantage using varchar in PostgreSQL. Just the length constraint checking.

Contrariwise there's no advantage to using text either.

Re:Falsehoods Programmers Believe About Names – With Examples by throwaway2048 on Friday November 30, 2018 @10:57AM (#18569965)
Longer than 200 characters?
Re:Falsehoods Programmers Believe About Names – With Examples by masklinn on Friday November 30, 2018 @02:13PM (#18571732)
Makes no difference to postgres. The one and only difference is that you can limit the length of a varchar when you define the column but that aside the storage mechanism is the one I quoted above for both, and for char as well:

> There is no performance difference among these three types (nb: varchar, char and text), apart from increased storage space when using the blank-padded type, and a few extra CPU cycles to check the length when storing into a length-constrained column. While character(n) has performance advantages in some other database systems, there is no such advantage in PostgreSQL; in fact character(n) is usually the slowest of the three because of its additional storage costs. In most situations text or character varying should be used instead.

And for applications which introspect the schema and display different field types depending on the column type, well you may not want a textarea for a name field.

Re:Falsehoods Programmers Believe About Names – With Examples by pandler on Friday November 30, 2018 @05:28PM (#18573324)
Where’s a reasonable cut off point? Surely you don’t want someone uploading a copy of War and Peace as their name.
Re:Falsehoods Programmers Believe About Names – With Examples by mauricioc on Friday November 30, 2018 @07:18AM (#18568541)
Portuguese-origin names can be a bit ridiculous in this sense as well. Famously around here, the first emperor of Brazil was named "Pedro de Alcântara Francisco António João Carlos Xavier de Paula Miguel Rafael Joaquim José Gonzaga Pascoal Cipriano Serafim" [1]. That's 128 characters, beating Picasso's example! The tradition of long names persists to this day, although not to this extreme.

[1] https://en.wikipedia.org/wiki/Pedro_I_of_Brazil#Birth

Re:Falsehoods Programmers Believe About Names – With Examples by JetSetWilly on Friday November 30, 2018 @07:32AM (#18568598)
That still violates point 11:

"People’s names are all mapped in Unicode code points."

It seems like it is impossible to address all these points. Obviously there's no way for me to allow people to enter their names which don't have any known code point. So at some point you're always going to be saying "tough luck, you must adapt your name - or come up with something - that confirms to these constraints." And I am sure people are clever enough to do so.

Re:Falsehoods Programmers Believe About Names – With Examples by gvx on Friday November 30, 2018 @07:39AM (#18568642)
That point and point 40 ("People have names") can't be solved by technical means. There are two options here:

- You can make name fields optional for people without (representable) names - You can loosen what the field stands for to "what you want us to call you": for people who don't have a (representable) name, they can choose an alternative, without implying the user's (lack of) name is Wrong.

Re:Falsehoods Programmers Believe About Names – With Examples by raverbashing on Friday November 30, 2018 @08:41AM (#18568988)
Yes, you can't solve all cases but I'm betting someone will find a workaround for the sub 0.1% of those cases.

Much more rare than your system breaking because it chokes on the apostrophe in O'Donnels or something similar.

Re:Falsehoods Programmers Believe About Names – With Examples by Piskvorrr on Friday November 30, 2018 @07:53AM (#18568708)
This is not a design requirement - just something to keep in mind when designing a system. Otherwise, you're going to have a tough time requiring a `tussenvoegsel` form field in cultures where nobody knows what that is (spoiler: it's the Dutch "van " prefix; been there), or requiring that everyone has a middle name (USA), or a second surname (Mexico).

In other words, the usual problem is not "how do I fulfill all of these things?", but "how do I convince the USians that ASCII is not just insufficient, but that not even using Latin-1 won't do?"

Re:Falsehoods Programmers Believe About Names – With Examples by ZiiS on Friday November 30, 2018 @10:28AM (#18569743)
You could just allow them to draw/upload an image.
Re:Falsehoods Programmers Believe About Names – With Examples by Piskvorrr on Friday November 30, 2018 @08:13AM (#18568794)
Well...there's Monty Python's John Gambolputty. https://www.youtube.com/watch?v=UDPqB9i1ScY

While a comical exaggeration, there simply isn't a hard limit - just somebody drawing the line and saying "640 kB should be enough for anybody."

As for "ridiculous" - having many names is apparently a nobility custom, even if most people don't insist on using the full name in everyday matters: https://en.wikipedia.org/wiki/Karel_Schwarzenberg is also Karl Johannes Nepomuk Josef Norbert Friedrich Antonius Wratislaw Menas Fürst zu Schwarzenberg and Karel Jan Nepomuk Josef Norbert Bedřich Antonín Vratislav Menas kníže ze Schwarzenbergu (oh look, several non-equivalent but canonical names!)

Re:Falsehoods Programmers Believe About Names – With Examples by logfromblammo on Friday November 30, 2018 @12:05PM (#18570486)
Name field is a blob that can contain a vector graphic with animation capability, or an audio file. Each individual can have 0 to n names. For each name, allocate a canvas for the image and scale the name image into it, or present audio controls. A person with no name may be identified by pronouns.

If someone manages to change their name to a taste, smell, or tactile sensation, you may need to revise your system again.

A deaf person may consider their name to be a series of hand movements. A mariachi may identify by their signature grito. A luchador may be known mainly by the pattern on their mask. A corporation has its logo, trademarks, and audio marks ("by Mennen", Meow Mix jingle, etc.). A tiny purple musician could switch to an unpronounceable symbol, to protest something in their recording contract. Clowns are identified by their egg.

If your name is a million Unicode characters long, you might need zooming and panning capability for your name canvas.

Re:Falsehoods Programmers Believe About Names – With Examples by JustSomeNobody on Friday November 30, 2018 @11:15AM (#18570107)
First of all, there should be no artificial limitations. This is something that always comes back to bite developers.