• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Lesson 13. Validating Data > The Logic Behind Validating Data

The Logic Behind Validating Data

We validate things every day—from words in a sentence (to make sure they make sense) to change received from purchases. The concept of validation is a natural and easy one for us to understand. For example, examine the following (U.S.) phone number: 555-34567. Chances are you quickly recognized the phone number to be invalid. How? Your brain analyzed the phone number and noted that it contained eight digits. After comparing this fact to the rule that defines valid local phone numbers as those that include seven digits, your brain made a determination of true (the number was valid) or false (it was invalid). If you determine that the number is valid, you can place the phone call. If the number is invalid, however, your brain will log an error message—something similar to “That number is wrong. I need to get the correct number and then try to call.”


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint