ArticleslgStudy

science

DWIM

DWIM is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand DWIM rather than just read about it. In short: 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.

Key takeaways

  • DWIM belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect DWIM to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of DWIM from memory before moving on to harder problems.

Reference excerpt

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", similarly to autocorrection for natural language. Teitelman and his Xerox PARC colleague Larry Masinter later described the philosophy of DWIM in the Interlisp programming environment (the successor of BBN Lisp):

Although most users think of DWIM as a single identifiable package, it embodies a pervasive philosophy of user interface design: at the user interface level, system facilities should make reasonable interpretations when given unrecognized input. ...the style of interface used throughout Interlisp allows the user to omit various parameters and have these default to reasonable values... DWIM is an embodiment of the idea that the user is interacting with an agent who attempts to interpret the user's request from contextual information. Since we want the user to feel that he is conversing with the system, he should not be stopped and forced to correct himself or give additional information in situations where the correction or information is obvious.

Critics of DWIM argued 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", with others suggesting that the acronym 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 comment-dwim 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 magit-diff-dwim 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 magit-diff-dwim 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 AI agent

References

Further reading Warren Teitelman, "Automated programmering [sic]: the programmer's assistant", in Proceedings of the FJCC, 1972 doi:10.1145/1480083.1480119

Worked examples

Example 1 — a first encounter with DWIM

Start with the simplest possible case. Write down what DWIM claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to DWIM before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about DWIM ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of DWIM

In research
DWIM appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses DWIM in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
DWIM is common in secondary-school and first-year university syllabi. It links to neighbouring topics Spell checkers, Text editor features, Usability, so understanding it makes those chapters shorter.
In everyday life
Look for DWIM outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “DWIM” →

How to study DWIM in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what DWIM means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain DWIM out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is DWIM in simple terms?

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…

Why does DWIM matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study DWIM?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on DWIM.

Tags

  • Spell checkers
  • Text editor features
  • Usability

Keep exploring