Lists Home |
Date Index |
Berend de Boer <firstname.lastname@example.org> writes:
> >>>>> "Michael" == Michael Kay <email@example.com> writes:
> Michael> It depends a bit how many errors validation
> Michael> catches. Since phone numbers have no check digit, most
> Michael> errors will get through anyway.
> Not errors involving length or area code checks. But phone numbers is
> just one example. The thread headed towards the: because checking
> sometimes fails (insert weird case example), don't check.
> My customers have actually asked for more stringent checks in several
> cases, so they probably perceived value. But it's still an interesting
> question: where do you stop, where do you check (data entry or cleanup
> later), what do you accept.
I'd say the most important thing is not to use a feature just because
it exists, and it goes for validation as much as for anything else. I
keep seeing tutorials that insist on using xsd:integer for things like
part numbers -- where in fact these are obscure strings as far as the
validator is concerned -- just because integers exist. I also keep
seeing HTML forms where the "country" part of the address is a
drop-down list, 150-odd long, of all UN members, just because it's
available. The list ensures only "legal" values can be entered*, but
it checks for membership in a wrong set -- UN member nations as
opposed to nations where the site has or wants to have customers. I
wonder how many sites have users in Afghanistan?
Another question to ask is what it really mean for a datum to be valid
wrt your application. Validity for a phone number is most often the
promise of reaching a specific person (or function) if you dial it,
not that it exists at some telephone exchange. I once had some repairs
made to a car at a national franchise in the Boston area. The
mechanic, who spoke very little English, said their computer required
an address. I said I didn't have a US address. He said they couldn't
service the car if it didn't go through the computer. I said 1600
Pennsylvania Ave Washington, DC. The mechanic failed to see the joke,
and so did the computer, because it was, after all, a perfectly valid
(*) as long as one doesn't construct the HTTP request manually -- I
wonder how many sites check that.