the principle of least astonishment

expression

programmingweb dev

A component should behave the way most users will expect it to behave; surprise is a defect.

The principle, circulating since the 1970s, judges designs by the gap between what they do and what a reasonable user predicts: an interface that astonishes will be misused, however well documented. It governs API design, defaults, error handling, and UI alike. When two implementations are equally correct, ship the one that needs no explanation.

Also known as: POLA, least surprise

All glossary entries