R
Validation of names and names is a bad idea.♪ You don't need anything but annoying users when they need to introduce something that doesn't pass your "universal" test.Let's go to classics.So, for the sake of the common good, I've drawn up a list of assumptions that your system possibly can make about people's names. All these assumptions are mistaken.♪ At least try to reduce the list when you design the system next time.Every man has one canonic full name.Every man has one full name he uses.At this point, every man has one canon full name.At this point, everyone has one full name that he uses.Every man has exactly N names, regardless of N.Names are included in a number of symbols.Names don't change.Names change, but only in certain limited cases.Names are recorded in ASCII.Names are recorded in a single code.All names correspond to the symbols of Unicode.Names are sensitive to the change of register.Names are not sensitive to the change of register.Sometimes the names meet prefix or souffix, but you can safely ignore them.Names don't contain numbers.Names cannot be recorded by CEFICY TRIPS.Names cannot be written in whole building letters.The names are in order. The selection of one of their sequences will automatically lead to constant order among all systems if they all use the same set-up.The name is necessarily different.People have a family name or something like that.The name is unique.The name is almost unique.Okay, okay, but names are rare enough, so there's no million people with the same name and name.My system will never deal with names from China.Or Japan.Or Korea.Or Ireland, the United States of America, Mexico, Brazil, Peru, Sweden, Botswana, South Africa, Trinidad, Haiti, France, the Klingon Empire, all of which use " foreign " schemes for names.The Klingon Empire was a joke, wasn't it?To hell with cultural relativism! People in my society at least have the same idea of a generally accepted standard for names.There's an algorithm that transforms names into one and the other without losing. (Yes, yes, you can do that if the algorithm on the way back the same way in, take your medal.I can reasonably assume that this vocabulary of uncensored words does not contain names.People are given names at birth.OK, maybe not at birth, but pretty soon after him.Okay, okay, within a year or so.Five years?You're kidding, right?Two different systems with the name of the same person will use the same name for him.Two different data entry operators, if given a human name, will necessarily have the same set of symbols if the system is well designed.People whose names break my system are weird aliens. They're supposed to have normal, acceptable names, sort of.People have names.The list is in no way exhaustive. If you need examples of real names that deny any of these paragraphs, I'd be happy to call them. You may add other paragraphs to this list of misconceptions in the commentaries, and send a reference to this list to people the next time they get a genius idea to make a database with columns first_name and last_name.Sous: http://habrahabr.ru/post/146901/