A place to cache linked articles (think custom and personal wayback machine)
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

index.md 5.4KB

il y a 4 ans
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. title: Falsehoods Programmers Believe About Names
  2. url: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/
  3. hash_url: 61fb6db44e7173cd9318753c955f7dda
  4. <p>[This post has been translated into Japanese by one of our readers: <a href="http://www.emptypage.jp/translations/kalzumeus/falsehoods-programmers-believe-about-names.html">和訳</a>もあります。]</p>
  5. <p>John Graham-Cumming wrote an <a href="http://blog.jgc.org/2010/06/your-last-name-contains-invalid.html">article</a> today complaining about how a computer system he was working with described his last name as having invalid characters.  It of course does not, because anything someone tells you is their name is — by definition — an appropriate identifier for them.  John was understandably vexed about this situation, and he has every right to be, because <strong>names are central to our identities</strong>, <em>virtually by definition</em>.</p>
  6. <p>I have lived in Japan for several years, programming in a professional capacity, and I have broken many systems by the simple expedient of being introduced into them.  (Most people call me Patrick McKenzie, but I’ll acknowledge as correct any of six different “full” names, any many systems I deal with will accept precisely none of them.) Similarly, I’ve worked with Big Freaking Enterprises which, by dint of doing business globally, have theoretically designed their systems to allow all names to work in them.  <strong>I have never seen a computer system which handles names properly and doubt one exists, anywhere</strong>.</p>
  7. <p>So, as a public service, I’m going to list assumptions your systems probably make about names.  <strong>All of these assumptions are wrong</strong>.  Try to make less of them next time you write a system which touches names.</p>
  8. <ol>
  9. <li>People have exactly one canonical full name.</li>
  10. <li>People have exactly one full name which they go by.</li>
  11. <li>People have, at this point in time, exactly one canonical full name.</li>
  12. <li>People have, at this point in time, one full name which they go by.</li>
  13. <li>People have exactly N names, for any value of N.</li>
  14. <li>People’s names fit within a certain defined amount of space.</li>
  15. <li>People’s names do not change.</li>
  16. <li>People’s names change, but only at a certain enumerated set of events.</li>
  17. <li>People’s names are written in ASCII.</li>
  18. <li>People’s names are written in any single character set.</li>
  19. <li>People’s names are all mapped in Unicode code points.</li>
  20. <li>People’s names are case sensitive.</li>
  21. <li>People’s names are case insensitive.</li>
  22. <li>People’s names sometimes have prefixes or suffixes, but you can safely ignore those.</li>
  23. <li>People’s names do not contain numbers.</li>
  24. <li>People’s names are not written in ALL CAPS.</li>
  25. <li>People’s names are not written in all lower case letters.</li>
  26. <li>People’s names have an order to them.  Picking any ordering scheme will automatically result in consistent ordering among all systems, as long as both use the same ordering scheme for the same name.</li>
  27. <li>People’s first names and last names are, by necessity, different.</li>
  28. <li>People have last names, family names, or anything else which is shared by folks recognized as their relatives.</li>
  29. <li>People’s names are globally unique.</li>
  30. <li>People’s names are <em>almost</em> globally unique.</li>
  31. <li>Alright alright but surely people’s names are diverse enough such that no million people share the same name.</li>
  32. <li>My system will never have to deal with names from China.</li>
  33. <li>Or Japan.</li>
  34. <li>Or Korea.</li>
  35. <li>Or Ireland, the United Kingdom, the United States, Spain, Mexico, Brazil, Peru, Russia, Sweden, Botswana, South Africa, Trinidad, Haiti, France, or the Klingon Empire, all of which have “weird” naming schemes in common use.</li>
  36. <li>That Klingon Empire thing was a joke, right?</li>
  37. <li>Confound your cultural relativism!  People <strong><em>in my society</em></strong>, at least, agree on one commonly accepted standard for names.</li>
  38. <li>There exists an algorithm which transforms names and can be reversed losslessly.  (Yes, yes, you can do it if your algorithm returns the input.  You get a gold star.)</li>
  39. <li>I can safely assume that this dictionary of bad words contains no people’s names in it.</li>
  40. <li>People’s names are assigned at birth.</li>
  41. <li>OK, maybe not at birth, but at least pretty close to birth.</li>
  42. <li>Alright, alright, within a year or so of birth.</li>
  43. <li>Five years?</li>
  44. <li>You’re kidding me, right?</li>
  45. <li>Two different systems containing data about the same person will use the same name for that person.</li>
  46. <li>Two different data entry operators, given a person’s name, will by necessity enter bitwise equivalent strings on any single system, if the system is well-designed.</li>
  47. <li>People whose names break my system are weird outliers.  They should have had solid, acceptable names, like 田中太郎.</li>
  48. <li>People have names.</li>
  49. </ol>
  50. <p>This list is by no means exhaustive.  If you need examples of real names which disprove any of the above commonly held misconceptions, I will happily introduce you to several.  Feel free to add other misconceptions in the comments, and refer people to this post the next time they suggest a genius idea like a database table with a first_name and last_name column.</p>