Thursday, March 13, 2008

Do you not want to exit? yes, no, cancel, FileNotFound

This article refers to UI best practices

The title of the post is of course an exaggeration of asking negative questions but serves as a perfect example for what I'm trying to tell you
I thought the title of this post was an exageration, but after seeing that dialog...

Don't ask the user negative questions

More often than not you'll confuse that crap out of the poor user; users are already too scared of answering questions to still bother them with the opposite of what they want, it's a simple and basic rule, but I still see a lot of software (and developers) that use negative questions/options for data input.

The most common use of negative options is probably disabled

just compare:
Label X visible?
Field X Enabled?

To:
Label X Invisible?
Field X Disabled?

That subtle change makes it much harder to answer the question correctly; so prefer Enabled over Disabled, Visible over Invisible, Active over Inactive, etc

The same concept applies when naming variables or methods, in very few cases the negative is a better option, so just go with the safer option, it's easier to process, we are used to answer "positive questions" and the opposite usually causes us to think which makes things not intuitive

3 comments:

Anonymous said...

I agree with you. Code is easier to read when the 'questions' [read: if & while] are written positively. I think Steve Mc Connell writes about this in his book 'Code Complete 2nd Edition'. The 'The Framework Design Guidelines' (Abrams & Cwalina), have a guideline that advises us to exactly do this:
"DO name Boolean properties with an affirmative phrase (CanSeek instead of CantSeek) [Visible instead of Hidden]. Optionally, you can also prefix Boolean properties with 'Is', 'Can', or 'Has' but only where it adds value."

Rainer Hilmer said...

I totally agree. We see it often on certain windows message boxes. What makes things even worse is when the message is an unclear statement which cannot be answered by OK or cancel. So the user doesn't know which button to click.

Anonymous said...

Hopefully you understand the real underlying reason why that particular message box is backwards... they're trying to abuse a browser feature and get you to install their crap...