in reply to Re: Regex (lookahead) Confusion
in thread Regex (lookahead) Confusion

Thinking of the user is what prompted this post. OK, it was really about my lack of experience when it comes to lookahead assertions. However, I was thinking that the user may not be as familiar with the config files that will be managed by this application. Instead of forcing the user to know all the syntax rules for the config files, I check to make sure the syntax is correct. If it is not correct, I don't think I would want to take a guess at what the user meant. I'm not a mind reader. And if I simply accept the user input without being sure that the syntax and parameters are correct, there is a high probability that the program will fail due to the incorrect config information.

Let's say you dial a phone number and enter a 1 then area code then the number. You then get the recorded response informing you that you don't have to dial a 1 first. My guess is that you are thinking the phone company should understand that you don't know how to use a telephone and are not willing to learn. Therefore they should just connect you to the number you dialed. OK. Perhaps you misdialed the area code and you really did have to dial a one. Well now the phone company has connected you but not to the number you dialed and not to the number you intended to dial. Now two people are frustrated (you and the person you just disturbed for no reason).

I think it is very important that we understand most people will say the same thing in different ways. At the same time, we must understand that many software applications only understand the information if it is presented in a specific manner. I'm, sorry if this is offensive to you but I will never trust the user input implicitly and will always strive to be sure the data conforms to its pre-defined parameters.

Replies are listed 'Best First'.
Re: Re: Re: Regex (lookahead) Confusion
by halley (Prior) on Feb 06, 2004 at 20:03 UTC

    If the phone system knows I made an error, and knows the nature of the error, it should recover for my error. If it didn't know these things, then why did it explain my error so accurately?

    The structure of telephone systems is to understand how many more digits to expect from the user at any time. Area codes don't start with 0 or 1. This sets up the system to understand the next three digits. Some locales can't distinguish a new-style area code from a historically significant local prefix. The error messages are completely disregarding the user's goals, and instead forcing the user to learn the artificial local dialing hardware implementation. These vary from region to region, so a traveler currently has to cope with varying machine requirements, which have nothing to do with the goal of making a connection.

    I didn't say you HAD to recover from the user's errors by fixing it. Unlike the examples, it's not always possible. But you can give a more intelligent answer than "start over from scratch, complying with this rule you didn't know, you stupid user."

    Since you're writing the code that helps users accomplish a correct configuration, you know both what the machine expects, and what the user wants to express. You're the ONLY person in this chain who could provide a more intelligent interaction. You can make the computer provide tools to accomplish goals for a wider range of users.

    Don't expect the user to learn everything you did. If they mistype something, then help them accomplish their goals, rather than helping them learn the machine details you had to learn.

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