Darwin's Theories Blog

New Theories for a New Time

Don't Make Me Think: The Hideous Number

2022-06-21
Web Sites that fail the test of simplicity

Don’t Make Me Think is a user-experience (UX) book that has been through several editions. I mention this approvingly, as computer tech books that only last one edition usually are market failures. Did I mention that my Java Cookbook is on its fourth edition?

The Hideous Name was a technical paper by Rob Pike and P.J. Weinberger complaining about the complexity of some computer network naming conventions.

Anyway, not much of a book or article review this is, but I wanted to reiterate some basic UX problems. With solutions.

First, telephone numbers. For some reason, a number of web sites require you to enter them in a very rigid format. Sometimes, you have to enter it with dashes between segments, like 416-555-1212. Other sites require that you enter it, not how you’d write it down, but without the dashes. Worse, they usually don’t tell you, until they do a full form submit and reject the submission with a message like "invalid phone number", often not telling you what picayune formatting rules they demand. Would it be too much trouble to put the note about "no dashes" in bold on the web form? As I have written many times, users should not have to care how you store numeric strings internally. It is a matter of one line of code to remove dashes if you don’t need them (to wit, either numberInput.replaceAll("-",""); or numberInput.replaceAll("[^\\d]","");, whether in Java, or in JavaScript, or in most related languages used to write web sites. The latter form would also remove spaces, parenthesis, leading + signs, and anything else but digits ('^\\d' means "not a digit").

Of course the same applies to zip codes / post codes. The US Zip Code is well known; it’s 5 digits with optionally a dash and 4 more digits. Period. Canadian Post Codes are in the form ANA NAN, where A is a letter and N is a number. For example, the code HOH 0H0 is the post code for Santa Claus (well, actually to post office volunteers who answer childrens' letters to Santa). M5S 1A1 is the post code for the University of Toronto. You get the idea. Again, some sites require you to enter the mandatory space in the middle, while others ban it. And some of these just fail with "Invalid post code.".

So all the devs who write web sites, please be tolerant of users who dare to enter phone numbersd post codes in the "correct" form that differs from your idea of correctness. Just strip out all the extraneous characters, make sure you have some characters left, and try to format them reasonably. For Canadian post codes, put the middle space back in when you’re done. The customers you save may be your own.