eli5: What is non validated input?

264 views

eli5: What is non validated input?

In: 1

4 Answers

Anonymous 0 Comments

Things have to be in a usable state before they can be used for their intended purpose.

Basically, imagine that you are going to make Thanksgiving Dinner. You buy a turkey, potatoes, a box of stuffing, et cetera.

You don’t eat the turkey unless it’s been put into the right format(cooking it). You don’t eat raw potatoes, or literally eat the box with the stuffing ingredients inside of it. Before you use things, you check to make sure that they are in a condition in which you have the ability to use them.

You understand the difference between an uncooked turkey and a cooked turkey. In order to tell the difference, you check for certain things: the color of the skin, the smell, the temperature, et cetera.

Similarly, when you’re dealing with computers, computers have data types. Sentences are stored as a string of letters. Numbers are stored as numbers, et cetera.

But computers aren’t very smart. They don’t understand context. If you tell a computer to add the ocean plus the number 5, it’s going to try to do that. And as I’m talking to you, you can tell that the ocean can’t be added to the number 5.

Or if you were trying to add soda to a machine that sells cans of soda, as a human, you’d know that you can’t just pour a Coke into the machine. The machine is made to handle sodas, but they have to be in the format the machine expects(in a soda can).

What validation does is to make sure that the information that’s entered is in a format that can be used in the way it’s expecting to be entered. So if it’s asking for a number and you entered something that’s not a number, it’s going to complain.

Similarly, if it asks for a name, and you entered numbers, it will probably complain.

Non-validated input is when no checks have been applied to make sure that the entered information is in a format that can be used as expected. If you don’t validate input, you’re occasionally going to find that the computer has trouble handling your data, because whatever’s put in was in the wrong format.

You are viewing 1 out of 4 answers, click here to view all answers.