Principle of least astonishment

APIs, UI, and system behavior should match what users and callers expect. If a name suggests one behavior, it must deliver that behavior. Side effects should be obvious from the API signature.

  • Name functions and types so a reader can predict what they do without reading the implementation
  • If a method mutates state, make that visible in the name or signature — never hide side effects
  • Follow platform naming conventions even when you prefer a different style
  • When reviewing code, ask: "Would a new team member be surprised by this behavior?"
version
1.0.0
tags
principle-of-least-astonishment
author
Mike Fullerton
modified
2026-03-27

Change History

Version Date Author Summary
1.0.0 2026-03-27 Mike Fullerton Initial creation