Think of the User

I don't know if you're trying to balk at user-supplied information, or not, but just in case, I thought I'd rant for a minute.

I am thoroughly annoyed at any web form which gives me an error like the following:

Credit Card Numbers cannot contain spaces or dashes. Please enter your card number again in the proper format.

It makes me want to vote the rascals out, whenever an online tax form quibbles about dashes in government identifiers.

Your Social Security Number has three groups of digits, separated by dashes. To ensure your entry is correct, please re-enter your number in the format, ###-##-####.

I want to hang up on telephone systems when they whisper this nonsense in my ear:

You must first dial a One before your number. Please hang up, and dial your number again, beginning with a One, then your party's area code, then your party's number.
Or conversely,
You do not need to dial a One before your number. Please hang up, and dial your number again, beginning with your party's area code, then your party's number.
The security camera is the only thing stopping me from punching an ATM which requires me to enter the extra fraction zeros, when the machine is only equipped to dispense $20 bills.
Please enter the amout you wish to withdraw: $___.__ Your amount must be a multiple of $20.00.

If your system can accept the input as it is, then ACCEPT THE INPUT.

If your system can weed out the obviously extraneous information, then weed it out, and ACCEPT THE INPUT.

If your system can weed out the extraneous information, but it might not be what the user intended, then weed it out, and ACCEPT THE INPUT. In critical cases, confirm the input with an alternative display, and allow them to re-enter the information if it was interpreted incorrectly.

If your system can detect the difference between extraneous and possibly mistaken input, then show the user how your code interpreted their input, and ask for confirmation.

Days of the week? m,t, w-f You have entered: Monday Tuesday Wednesday Friday You may have entered something I don't recognize. Did I understand your schedule correctly? [ Yes ] No

Lastly, I have seen people try to associate 'H' for Thursday but never 'A' for Saturday. I don't think people will remember either one reliably, especially if they're not native English writers. Think of what your users want to see and specify, not what would fit in a single letter uniquely. These clever one-letter abbreviations should just be an implementation detail, not a user interaction plan.

Writing user interaction code is more labor-intensive on your part, and more demanding in terms of design consideration. However, you're going to foist any of these frustrations on each one of your users, every time they use it. In aggregate, that's a lot of frustration to dispense for just a few minutes of design time you save.

Be forgiving in what you accept, and strict in what you produce.

--
[ e d @ h a l l e y . c c ]


In reply to Re: Regex (lookahead) Confusion by halley
in thread Regex (lookahead) Confusion by ChrisR

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.