Principle of least astonishment
The principle of least astonishment (POLA/PLA) applies to user interface
User interface
The user interface, in the industrial design field of human–machine interaction, is the space where interaction between humans and machines occurs. The goal of interaction between a human and a machine at the user interface is effective operation and control of the machine, and feedback from the...

 design, software design
Software design
Software design is a process of problem solving and planning for a software solution. After the purpose and specifications of software are determined, software developers will design or employ designers to develop a plan for a solution...

, and ergonomics
Ergonomics is the study of designing equipment and devices that fit the human body, its movements, and its cognitive abilities.The International Ergonomics Association defines ergonomics as follows:...

. It is alternatively referred to as the rule or law of least astonishment, or the rule or principle of least surprise (POLS).

The POLA states that, when two elements of an interface conflict, or are ambiguous, the behaviour should be that which will least surprise the user
User (computing)
A user is an agent, either a human agent or software agent, who uses a computer or network service. A user often has a user account and is identified by a username , screen name , nickname , or handle, which is derived from the identical Citizen's Band radio term.Users are...

; in particular a programmer
A programmer, computer programmer or coder is someone who writes computer software. The term computer programmer can refer to a specialist in one area of computer programming or to a generalist who writes code for many kinds of software. One who practices or professes a formal approach to...

 should try to think of the behavior that will least surprise someone who uses the program, rather than that behavior that is natural from knowing the inner workings of the program.

This practice also involves the application of sensible default
Default (computer science)
A default, in computer science, refers to a setting or value automatically assigned to a software application, computer program or device, outside of user intervention. Such settings are also called presets, especially for electronic devices...



  • A user is about to enter his username and password for a program or website when he receives an instant message. Some instant messaging
    Instant messaging
    Instant Messaging is a form of real-time direct text-based chatting communication in push mode between two or more people using personal computers or other devices, along with shared clients. The user's text is conveyed over a network, such as the Internet...

     clients will immediately grab the keyboard focus
    Focus (computing)
    In computing, the focus indicates the component of the graphical user interface which is currently selected to receive input. Text entered at the keyboard or pasted from a clipboard is sent to the component which currently has the focus. Moving the focus away from a specific user interface element...

     and move it into their own response field, because they assume the user will want to respond to the new message immediately. In reality, the user may be astonished to find that they have just typed their password into their IM client and sent it to their friends. This conflict arises because the two programs are not aware of each other's existence, and cannot easily determine when they might get in each other's way. To avoid such conflicts, operating system
    Operating system
    An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

    s may restrict the interaction of different programs, for example by preventing the IM client from stealing the focus.
  • A user interface may have the behaviour that pressing causes the program to quit. The same user interface may have a facility for recording macros, a sequence of keystrokes to be played back later, intended to be able to control all aspects of the program. The user may want to record a keystroke sequence that includes as part (most likely the last part) of the macro. The principle says that pressing while recording a macro should not quit the program (which would surprise the user), but rather should record the keystroke.

See also

  • DWIM
    DWIM computer systems attempt to anticipate what users intend to do, correcting trivial errors automatically rather than blindly executing users' explicit but incorrect input...

     (Do What I Mean)
  • Occam's razor
    Occam's razor
    Occam's razor, also known as Ockham's razor, and sometimes expressed in Latin as lex parsimoniae , is a principle that generally recommends from among competing hypotheses selecting the one that makes the fewest new assumptions.-Overview:The principle is often summarized as "simpler explanations...

  • Law of Demeter
    Law of Demeter
    The Law of Demeter or Principle of Least Knowledge is a design guideline for developing software, particularly object-oriented programs. In its general form, the LoD is a specific case of loose coupling...

      (also known as the "principle of least knowledge")

External links

  • "Applying the Rule of Least Surprise" from The Art of Unix Programming
    The Art of Unix Programming
    The Art of Unix Programming by Eric S. Raymond is a book about the history and culture of Unix programming from its earliest days in 1969 to 2003 when it was published, covering both genetic derivations such as BSD and conceptual ones such as Linux....

    by E.S. Raymond
    Eric S. Raymond
    Eric Steven Raymond , often referred to as ESR, is an American computer programmer, author and open source software advocate. After the 1997 publication of The Cathedral and the Bazaar, Raymond was for a number of years frequently quoted as an unofficial spokesman for the open source movement...

  • Principle of Least Astonishment at Portland Pattern Repository
  • Principle of least astonishment on
  • Law of Least Astonishment from The Tao of Programming
    The Tao of Programming
    The Tao of Programming is a book written in 1987 by Geoffrey James. Written in a tongue-in-cheek style spoof of classic Taoist texts such as the Tao Te Ching and Zhuangzi which belies its serious message...

    by Geoffrey James
    Geoffrey James
    Geoffrey James is an author, journalist, and freelance writer. His works have been published in Wired, The New York Times, and ComputerWorld. He has written several books. He lives in New Hampshire. From February 2007 to September of 2011, he wrote a blog about sales for CBS Interactive...

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.