Conventional programming wisdom says you should always check any data input from the user and exclude anything that your code cannot cope with. [“User” … a strangely demeaning term for a person whom you are trying help. We need a new more respectful word for the people who are left struggling with the results of our coding. ]
Anyway, the normal practice with data validation is to only pass on whatever gets through the filters for further processing. All well and good. But what about the input you reject?
99% of the time when input is rejected the only action taken is to present the “user” with an suitably arrogant message.
"ERROR: We can only accept your information if you kneel with your knees exactly 10cm apart in front the great computer and bow deeply".
But what we as programmers routinely throw away contains vital nuggets of information – the cases we did not properly consider. Take my address for example. I live in a village where there are no road names or house numbers. What happens when I try to order something online?
I come up against the preconceptions of the programmer who designed the address form. House number and street name are required fields into which I’m forced to enter rubbish just in order to get my order accepted.
The fact that the program is expecting a house number and street name in each case is a design flaw. That information should be captured and fed back to the programmer.