Principle of less surprise
The principle of less surprise can be formulated in the following way:
To avoid with the user, in the simplest possible way, all them (bad) surprised.
It is sometimes called minimum principle of surprise ; in English, it receives the names of:
- Principle off Least Astonishment (minimum astonishment);
- Principle off Maximum Boredom (maximum trouble);
- Principle off Least Surprised (surprise minimum) or Polls .
Definition
The principle (or regulates) less surprise applies primarily to the data-processing field, though one can easily transpose it to many other fields, in particular in engineering in general.
In data processing, it is useful primarily in the following fields:
- design of man-machine interfaces;
- design of data-processing languages (and in particular of computer programming languages);
- Ergonomics of the software.
One can see there a transposition, theoretical field with the practical field, Rasoir of Occam or Principe of economy. When two elements of an interface enter in conflict, it recommends to privilege that which will surprise less the user or the programmer.
Applications
Helps
Many programs use, to call the assistance:
- the key “Helps” under Mac OS X;
- the key “F1” under Windows;
- the options - H and --help for the applications GNU.
The user expecting that the assistance is posted starting from such an action, the software must thus conform to it.
Options
In the basic commands of the systems derived from UNIX, this principle acquires an major importance. For example, for the order CP which is used for to copy files, there exist the following options:
- - R , which makes it possible to copy in a écursive way R ;
- - F , which allows F orcer the copy if there exists already a bearing file this name with the target site.
The order rm , which is used for to erase files, adopts the same options with the same significance: it is an application of the principle of less surprise. Because if, for more or less contingent reasons, the originators of this order had decided to reverse these two options, that could have, for the user, of the dramatic consequences. The application of this principle thus constitutes one of the principal rules of the programming; its formulation, for the programmer, could be as follows:
Adapts the behavior of your program to that until its user can reasonably wait.
Hierarchisation of the behaviors
The sequence Control-Q results often in to leave a program in certain user interfaces. The same interface can propose to create macros. If a user types Control-Q at the end of the definition of macro, it expects to rather leave the interface of definition of macros than the entire program; if the program chose to rather give the priority to the exit of the program than at the exit of the definition of macros, the user is likely to be surprised, and this surprise can have consequences which it had not provided. It is thus advisable to treat on a hierarchical basis the various levels of an interface (in fact, the level of the program and that of the definition of macros), in order to make the program most foreseeable, consequently most comfortable possible.
See too
Related articles
External bonds
-
"Applying the Rule off Least Surprise" , extract of The Art off Unix Programming of E.S. Raymond
- Principle off Least Astonishment with Portland cement Pattern Repository
| Random links: | Canton of Fountain-Seyssinet | Barnaby | François Besse | Eddie Evans | Down in It | Hamilton (Montana) | Coupe_du_monde_1982_de_la_FIFA |