Coding Horror

programming and human factors

Double-Click Must Die

Recently, we had this strange problem with a particular smart client application at work. It happened when the user clicked the OK button on a specific form. Like all difficult bugs, it was impossible for us to replicate. We put a bunch of diagnostic scaffolding into the deployed executable; this provided a number of clues. We knew that the submitted data had duplicates, somehow, and this was throwing duplicate record exceptions in the API. After a week of head scratching and asking ourselves how this could possibly happen, a fellow developer had an simple idea: what if we double-click on the OK button? Sure enough, that second click was somehow getting through to the UI and causing the OK button code to execute twice.

The fix is to disable the button and change the text in the OnClick event, as demonstrated in this JavaScript sample:

This problem is a powerful illustration of the way developers don't think like users. No developer would ever double-click on a button, because developers have too much GUI knowledge: only a single click is supported on this GUI element, so a double-click doesn't make sense here. Users, on the other hand, aren't burdened by this detailed knowledge of the GUI. Many users never fully learn the distinction between single-click and double-click. So they give up and simply.. double-click everything. I know it sounds crazy (to a developer), but I have observed it many times with real users using real applications, as in this KDE usability study:

Every single new KDE user I have ever casually observed was caught by surprise by KDE's "active" single-click default policy. Testing confirmed this observation. All test participants have task after task made the same mistake of double-clicking when a single-click would have been sufficient. Unfortunately, I neglected to ask test participants how they felt about this particular point -- I'm still new at this! -- but I know from observing them that it did slow them down. For instance, it made copying and pasting files difficult by creating superfluous windows to close and forcing them to concentrate on a task they were otherwise comfortable with. In one case, one user nearly saved his files in the Trash because of this. As he double-clicked the Desktop icon of the "Save As..." dialog box, the system interpreted his action as a single-click on the Desktop icon followed by a single-click on the Trash icon, the latter occupying the space of the former after a single "active" click. The user eventually backed out but never realized what he was about to do.

I'm not sure why KDE makes single-clicking its "active" click. Historically Macintosh and Windows desktops adopted the same conventions for icon selection and document opening: single-click is for selecting, double-click is for opening or launching. This is not always the case anymore but I have yet to see a computer user single-clicking on an icon to open a document or launch an application. The notion that double-clicking "does something" is in fact so entrenched that it is not uncommon to see people double-clicking on hyperlinks when surfing the web.

I don't blame the user here. Double-click has always been a bad idea. It was basically forced on the industry by Apple Computer when they elected to use a single button mouse on the original Mac in 1984. Technically, double-click is an optional shortcut for clicking an object and then clicking the File, Open menu; it's how you distinguish between selection (pick this one) and action (launch this one). I have some problems with double-click:

  1. How would anyone know, without being told, that double-click is a possible action? It's a completely hidden behavior. At least a two button mouse physically looks like it has two actions.
  2. The mechanics of double-clicking are unnecessarily demanding. It requires precise timing and good motor skills. Click too fast or too slow, or move the mouse too much between clicks, and you might miss the window. What next? Triple click? Click and hold? Mouse Gestures?
  3. I seriously question whether such a common action as "Activate"-- arguably far more common than "Select"-- should be tied to such an obscure, hard to perform physical gesture.
  4. Can't we just put another damn button on the mouse? Is two buttons really that hard to figure out? God forbid we put a 100+ key keyboard in front of people; their heads might explode!

One of the strengths of the web UI model is the way it uses single click exclusively, neatly avoiding the button overloading problem:

In the future, however, double-click must die since it causes novice users great difficulties and since it conflicts with the single-click interaction style of the Web. The main reason for double-click is to allow two operations to be overloaded onto a single-button mouse. Designers of more recent multi-button GUIs have faithfully duplicated a weaknesses that was made necessary by limitations of an early single-button GUI: let's do better in the future. Content applets should be particularly wary of double-click since people will think of them as single-click Web content. (Former Apple human evangelist Bruce Tognazzini provides further details about how newer window systems copied acknowledged weaknesses of the Mac: see his book Tog on Software Design.)

Double-click is such a profoundly bad idea that it actually manages to spill over into other applications and poison them with bad learned user behavior, eg, I better double-click on everything if I want anything to happen!

Thanks, Apple.. for nothing!

Written by Jeff Atwood

Indoor enthusiast. Co-founder of Stack Exchange and Discourse. Disclaimer: I have no idea what I'm talking about. Find me here: http://twitter.com/codinghorror