In interface design, always do the least surprising thing.1)
Never surprise the user. An interface should behave exactly as the user thinks it behaves. What surprises the user depends on the kind of interface (user interface, module interface) and the type of user (end user, fellow programmer, maintainer). The central idea of PLS is to think about how the user would want to use the interface.
Surprises are always a potential source for frustration. A user wants to be in control of the system. If the system does not behave as intended, the user gets disappointed and has to determine how to get the system do what it should do. On the other hand a system that behaves according to the users wishes is pleasant to use.
Secondly when everything works as expected, the user will make fewer mistakes. In case of a user interface this means that the user is more effective and in case of a module interface the software will have fewer defects.
interfaces
shall be adjectives describing a specific property. This typically results in names ending with -ablesqrt
)See section contrary principles.
The precise origin is unknown. Probably it's The Tao Of Programming by Geoffrey James.
Accepted: PLA is widely known and also treated in Eric S. Raymond's The Art of Unix Programming
Discuss this wiki article and the principle on the corresponding talk page.