Saturday, December 17, 2011

UI Forms - Server-based rules are anathema to me

Developers will often complain about implementing any but the simplest UI rules on the client (like, MAYBE, disabling the submit with appropriate indicators when some required fields haven't been filled out yet).

My kvetch on the subject:

Most times I think about server-based rules, I get this nagging compulsion to propose ways to make that rule client-based (or at least client/ajax-based).

The whole concept of a server-based rule is anathema to me.  It's saying that the all-powerful server knows something about what you're doing that you do not and will only grace you by contemplating your request after you've committed the form and then, sometimes, reject it for reasons you are only privileged to learn about after the fact. 

The whole point of computer-assisted user inputs is to surface what the user needs to know at the moment s/he needs to know it to avoid this 20-questions dialog between the supplicant and the silicon deity.

Ok, there's one exception: sometimes there's a business reason to be opaque about all of this, like when you are entering your userid and password.  The congenial UI design might be to say "you got your userid right, but you might have made a typo in your password?"  This would make it too easy for villainous scum to iterate hacking into your account.