Vol. I a living index of named laws · est. mmxxvi no ads · no account
The Law Tomeindex of named laws

The Principle of Least Astonishment

also known as — The principle of least surprise, POLA, Least surprise, Rule of least surprise
"A component should behave the way most of its users already expect, so that using it produces no surprise."
In plain English

What does The Principle of Least Astonishment mean?

Where a design has two defensible options and one of them matches what people already assume, take that one. Correctness is not enough: behaviour that is right and unexpected still costs every user the moment they discover it.

Reliability

Rated Heuristic: a dependable rule of thumb, not a proven theorem. The other 224.

Lineage
1967COINED
How it works

How does The Principle of Least Astonishment work?

People do not read documentation before acting; they act on a model built from everything similar they have used before. A design that matches that model is understood without being learned. A design that contradicts it is learned only after it has caused a failure, and the failure is expensive precisely because the user was confident: the wrongness was invisible until it produced a bug. A 1972 formulation puts the operational test crisply: every construct in the system should behave exactly as its syntax suggests. Where syntax and behaviour disagree, the reader is misled by the thing they are reading.

Where you'll see it

What are examples of The Principle of Least Astonishment?

parseInt and the leading zero JavaScript's parseInt once read a string beginning with 0 as octal, so parseInt('08') gave 0. Defensible by an old convention, astonishing to everyone entering a date.
The shortcut that already means something '?' shows the keyboard shortcuts in Gmail, YouTube and Jira; F1 opens help. A new application that uses either for something else spends its users' existing knowledge against them.
The delete that does not delete A command named delete that archives, or one named save that also publishes. The name is the user's model, and a behaviour wider than the name is a trap with a friendly label.
Why it matters

Why does The Principle of Least Astonishment matter?

It is the design principle that explains why convention beats cleverness in interfaces of every kind: APIs, keyboard shortcuts, command-line flags, configuration formats. It also supplies the argument against a certain class of technically superior design: superiority measured against a blank slate is worthless when the user is not a blank slate.

Working with it

How do you apply The Principle of Least Astonishment?

  • Match the neighbours — the strongest evidence about what a user expects is what every comparable tool already does. Deviating is a decision that needs a reason and a note.
  • Make the name the whole promise — if a function does something its name does not imply, the fix is usually the name rather than the documentation.
  • Name the audience out loud — the least surprising choice differs for an end user, a programmer and a system administrator, so the principle only becomes actionable once you have said which one you mean.
Where it breaks down

What are the limits of The Principle of Least Astonishment?

Astonishment is relative to an audience, and the article that states the principle says so: the least surprising behaviour for a system administrator is not the least surprising for an end user, and a design serving both must surprise one of them. It is also conservative by construction: held absolutely, it forbids every genuine improvement, because a better idea is by definition not what people already expect. And 'most users' is unmeasured in nearly every application of it; in practice the designer's own expectation is what gets used.

What it doesn't say

What are common misconceptions about The Principle of Least Astonishment?

It is not a rule that software should be simple, nor that it should never do anything novel. It concerns the gap between what a thing appears to do and what it does: a complicated system whose parts behave as their names suggest satisfies it, and a simple one full of quiet special cases does not.

Is it real?

Is The Principle of Least Astonishment real?

Real as a rule of thumb, not as a theorem. The Principle of Least Astonishment is rated Heuristic here: dependable enough to plan with, and with no proof behind it.

Rated from one source. 225 of the 1,116 entries carry this rating. How the scale works.

Seldom printedin printed books: one of 194 names in its band, of 903 measured
25 of 69entries in software & systems carry the same rating

The best-known laws are the least likely to rest on measurement; the full verdict on The Principle of Least Astonishment.

Origin

Where did The Principle of Least Astonishment come from?

Circulated in computing from the late 1960s; an early reference appears in the PL/I Bulletin in 1967, and the principle was stated in print in a 1972 systems-programming-language paper as the requirement that every construct in the system behave exactly as its syntax suggests. It has no single named author.

How the name spread

When did people start saying “The Principle of Least Astonishment”?

1800coined 19672019
How often “Principle of Least Astonishment” appears in printed English, which takes hold around 1980 and peaks around 2019. Coined 1967 and in print by about 1980, unusually close together. This still charts the phrase rather than the idea. Source: Google Books Ngrams.
Sources

Sources & further reading

  1. 1"Principle of least astonishment." Wikipedia — the statement, the 1967 PL/I Bulletin reference, the 1972 print formulation, the parseInt and keyboard-shortcut examples, and the audience-dependence qualification.secondary

Everything above traces to en.wikipedia.org: a secondary source, an account of the original rather than the original itself, which has not been located for this entry. Nothing is written from memory, and the method is written down. Spot an error or a better source? Suggest a fix.

What we checked

  • 1,116entries in the tomeListed one by one on the browse page.
  • 1,116of them citing a sourceOpen any entry: its sources sit at the foot of the page.
  • 2,489source references in allEach is named, and linked wherever the source is online.