I solve this problem by running a simple statistical analysis of representative information that would go into the fields. The goal is to understand how long typical strings are so we can avoid overflows in text entry fields, which is a not-great experience.
As an example, for my current company's customer base*:
- 99% of first names have 9 or fewer characters.
- 99% of last names have 12 or fewer characters.
(We don't design to the max value because the max allowed name string is 255 characters; there's always some goofy data in the database that can throw off a max statistic.)
Here's how to do this analysis:
- If you already have a user base, pull a list of customer first and last names from your database for this analysis. 5,000 names should be adequate. Alternately, find a publicly available dataset – e.g. a phone book.
firstname is one column / field,
lastname is another column / field. Import the data into a spreadsheet.
- Create new columns
firstname is column A, fill
firstname_len with a string length formula, e.g.
=len(a2). Copy down into all cells. Repeat in another column for lastname.
firstname_len is column C: Use
=percentile(c2:c, .99) to calculate the 99th percentile of lengths for your data.
Here's an example of how to do this using street names (from a public dataset):
(*) Please note that our user base is US-only and has certain demographic traits that aren't representative of the general population, so YMMV.