DWIM (do what I mean) computer systems attempt to anticipate what users intend to do, correcting trivial errors automatically rather than blindly executing users' explicit but potentially incorrect input.

Software

The term was coined by Warren Teitelman in his DWIM package for BBN Lisp, part of his PILOT system, sometime before 1966.

InterLisp

Teitelman's DWIM package "correct[ed] errors automatically or with minor user intervention",

</blockquote>

Critics of DWIM claimed that it was "tuned to the particular typing mistakes to which Teitelman was prone, and no others" and called it "Do What Teitelman Means" or "Do What Interlisp Means", or even claimed DWIM stood for "Damn Warren's Infernal Machine."

Emacs

The concept of DWIM has been adopted in augmented form within the context of the GNU Emacs text editor to describe the design philosophy of Emacs Lisp functions or commands that attempt to intelligently "do the right thing" depending on context. The Emacs wiki gives the example of a file copy command that is able to deduce the destination path from a split window configuration that contains two dired buffers, one of which displays the source path; this behaviour also generalises to many applicable dired actions that take two directory paths for arguments.

DWIM behaviour, when available, is often mentioned in a command's name; e.g. GNU Emacs has a <code>comment-dwim</code> function that comments out a selected region if uncommented, or uncomments it when already commented out, while using comment characters and indentation appropriate for the programming language environment and current context.

This kind of DWIM is often not directly concerned with correcting user error but rather guessing user intent from available context. For example, the Emacs Magit package evinces this design philosophy pervasively. Among its numerous diff commands, there is a <code>magit-diff-dwim</code> command, which requires no further input from the user but simply guesses what the user wants to analyse based on the location of the cursor. The Magit User Manual describes the behaviour of <code>magit-diff-dwim</code> simply: "Show changes for the thing at point", "point" being the Emacs term for the text cursor (not the mouse pointer).

See also

  • Principle of least astonishment
  • Affordance

References