Empiriceme · Precept · Normative Principle

Principle of Least Astonishment

Also called Principle of least surprise

A component should behave as its users already expect, not as its author finds most elegant.

Software design folklore. It argues against cleverness in interfaces: a function that does something surprising but better is a defect, because callers reason from expectation rather than documentation.

In practice

  • A function named "save" that also sends an email is a defect, however useful the email.
  • A door handle that must be pushed where every other handle in the building is pulled will be pulled, and the labelling will not help.
Further reading
Wikipedia
Subject
Design & Systems
Essay
Rules of thumb for building things that work

Search every entry·Every entry, A to Z