Principle of least astonishment

For example, in writing, a cross-reference to another part of the work or a hyperlink should be phrased in a way that accurately tells the reader what to expect.

An early reference to the "Law of Least Astonishment" appeared in the PL/I Bulletin in 1967 (PL/I is a programming language released by IBM in 1966).

[14] In more abstract settings like an API, the expectation that function or method names intuitively match their behavior is another example.

[4] The choice of "least surprising" behavior can depend on the expected audience (for example, end users, programmers, or system administrators).

[18] In Windows operating systems and some desktop environments for Linux, the F1 function key typically opens the help program for an application.

In a departure from this convention, JavaScript originally defaulted to base 8 for strings beginning with "0", causing developer confusion and software bugs.