Principle of Least Astonishment

Do what people expect it to do.

A component should behave the way most of its users expect. Every surprise costs attention and trust, so follow the conventions people already know, choose sensible defaults, and make each control do what it looks like it does.

Origin

An early reference to a ’Law of Least Astonishment’ appeared in the PL/I Bulletin in 1967. IBM’s PL/I had become notorious for breaking it: because of its precision rules, 25 + 1/3 could stop with a fatal error or return 5.33 instead of 25.33. The law first appeared in print in 1972, in a paper on systems programming languages by Bergeron, Gannon, Shecter, Tompa, and van Dam, which asked that every construct behave exactly as its syntax suggests.

Eric S. Raymond made it the Rule of Least Surprise in The Art of Unix Programming (2003): borrow from functionally similar programs your users already know. Joshua Bloch applied it to API design in 2006. In interface design it is often summed up in one textbook line: people are part of the system, and the design should match their experience, expectations, and mental models.

The Principle

A component should behave the way most of its users expect. When behavior and expectation differ, change the behavior rather than the users: follow established conventions, choose sensible defaults, and make every control do what its appearance suggests.

Origin
PL/I Bulletin (1967) · in print 1972
Also called
Principle of least surprise
In practice
Match what users already expect
When to Use
How to Use
The classic 01 / 10

25 + 1/3 = 5.33

PL/I’s precision rules meant 25 + 1/3 could stop with a fatal error or, with errors suppressed, return 5.33 instead of 25.33. The language did exactly what its rules said and astonished everyone who used it.

Best for
Explaining the principle
Use when
Behavior follows internal rules
Avoid when
Users already know the rules
Conventions 02 / 10

Follow the Platform

People bring expectations from every other app. F1 opens help on Windows, and pressing ? lists the keyboard shortcuts in Gmail, YouTube, and Jira. Reusing a convention costs users nothing to learn.

Best for
Shortcuts, gestures, and controls
Use when
A platform convention exists
Avoid when
The convention fails your users
Labels 03 / 10

Say What Happens

A button or link should tell people exactly what to expect. A Download button that opens a sign-up form, or a Continue button that charges a card, breaks the promise and the trust that goes with it.

Best for
Buttons, links, and menu items
Use when
Writing action labels
Avoid when
The outcome is genuinely unknown
Defaults 04 / 10

Sensible Defaults

JavaScript’s parseInt once read ’08’ as octal because of the leading zero, a default that caused years of bugs until ECMAScript 5 dropped it. A default should match what most people mean.

Best for
Settings, forms, and APIs
Use when
Choosing a default value
Avoid when
No default suits most people
Consistency 05 / 10

Same Look, Same Behavior

Things that look alike should act alike. Two identical buttons that do different things, or a swipe that archives on one screen and deletes on another, surprise people every time.

Best for
Design systems and components
Use when
Controls look alike
Avoid when
The difference is clearly signaled
Audience 06 / 10

Whose Surprise?

What is least surprising depends on who is using it. Command-line users expect Unix flag conventions, Windows users expect its shortcuts, and beginners expect neither. Design for the audience you actually have.

Best for
Products with mixed audiences
Use when
Users come from different platforms
Avoid when
Everyone shares one background
Naming 07 / 10

Names That Match Behavior

Functions and methods should do what their names promise, with no side effects the name doesn’t suggest. The same goes for interfaces: a toggle labeled Notifications shouldn’t also unsubscribe someone from email.

Best for
APIs, settings, and toggles
Use when
Naming functions or controls
Avoid when
A name cannot capture the behavior
Remedy 08 / 10

Redesign the Astonishing

The corollary: if a necessary feature has a high astonishment factor, it may be necessary to redesign it. Usability tests show surprise directly in hesitation, repeated clicks, and the words ’wait, what happened?’

Best for
Usability testing and reviews
Use when
Users hesitate or undo
Avoid when
The surprise is a deliberate delight
✦

Least Astonishment in the Age of AI

AI can give a different answer to the same question and take actions nobody asked for. Predictability has to be designed in.

✦ AI Era 09 / 10

Preview Before Acting

An assistant that books, sends, or deletes on its own can astonish people in ways that are hard to undo. Say what will happen, show a preview, and ask before acting.

Shift
Surprise → preview
Use when
AI takes actions for the user
Watch for
Actions with no preview or undo
✦ AI Era 10 / 10

Matching the Mental Model

People treat an assistant like a person, a search box, or a command line, depending on what it resembles. State its capabilities and limits up front, so its behavior matches the model people bring.

Shift
Mystery → stated capabilities
Use when
Introducing an AI feature
Watch for
A blank prompt with no hints
Further Reading