“I’m tired of making all my decisions based on what some idiot might possibly do.”
– Bill Maher
When the brilliant comedian Bill Maher made that joke 15 years ago, he wasn’t talking about software development, but life in general. But he may as well have. I was a Computer Science student at the time and just being introduced into the world of validation, where some idiot might possible include a number or a ‘£’ character in his or her surname. With the advent of the web, validation seems to have become more about hacking prevention than helping customers who make genuine mistakes.
The great thing about MVC3 validation, is separation. Rules about what fields are required and the message that a user sees when that rule is broken is defined on the model classes. These rules can be applied on many forms.