A comment by SaltySeaDog over on my post Easier Property Validation with dynamic in C# 4* got me thinking.

You have some special use case that requires you to reinvent that wheel?

There are several wheels around - http://fluentvalidation.codeplex.com/ just to name one… or are you just prototyping for it’s own sake?

To tell the truth, I do think that someone needs to reform validation, not just within the .NET community, but for development in general.

Most validation frameworks (including every one of the dozens of frameworks I’ve downloaded and tried out) have an unhealthy obsession with data integrity at the expense of the user experience.

To a one, the frameworks wield a binary hammer - everything is either valid or invalid, and nothing invalid may pass, not under any circumstances at all.

Here’s a real world example I heard about just this past weekend: An ecommerce site that requires you to create a customer account before you can purchase. One of the mandatory fields on the customer account is a phone number - and that number must be formatted in the US style: (###) ### ####.

Unfortunately, New Zealand phone numbers aren’t written that way - we have area codes like 03, 09, 021, 029 and 0274, with phone numbers that are six, seven or eight digits long. Oddball? Certainly - but certainly valid as well.

Life isn’t binary - and validation shouldn’t be binary either.

We developers do actually know this - just look at our compilers.

Long past are the days were a compiler would just stop with a cryptic message at the first hint of trouble. Modern compilers are extremely good at error recovery, giving us not just one but a whole set of errors to fix up. Even better, our compilers give us warnings and hints as well, providing us with useful guidance that steers us away from poor practices and helps us write cleaner code.

If we value this kind of guidance so much that we build it into our own tools, why should we treat our users with any less respect?

Comments

blog comments powered by Disqus
Next Post
When Live Mesh fails  19 Nov 2011
Prior Post
Code Analysis failure  11 Nov 2011
Related Posts
Cryptic Error Codes  04 Apr 2015
Care about the User Experience  21 Jan 2013
Everything's broken but we can fix it  21 Sep 2012
First Impressions - Visual Studio 11  31 Mar 2012
Custom Chrome  26 Oct 2011
Validation can be the enemy  27 Jan 2011
Who's Needs First?  14 Dec 2010
A User Interface Stack Exchange  22 Oct 2010
Typography  20 Sep 2010
Vending Machine UX Fail  30 May 2010
More ux posts »
Archives
November 2011
2011