CSC/ECE 517 Fall 2007/wiki2 9 kk: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 34: Line 34:
The principle of least astonishment is used a lot in user interface design. [http://www.joelonsoftware.com/uibook/chapters/fog0000000057.html Joel Spolsky] has an article introducing user interface design using the principle of least astonishment. The article looks at a lot of examples of using the element of least suprise by comparing user interface design in Windows and Macintoshes.
The principle of least astonishment is used a lot in user interface design. [http://www.joelonsoftware.com/uibook/chapters/fog0000000057.html Joel Spolsky] has an article introducing user interface design using the principle of least astonishment. The article looks at a lot of examples of using the element of least suprise by comparing user interface design in Windows and Macintoshes.


A more general introduction to applying the principle of least astonishment can be found [http://www.faqs.org/docs/artu/ch11s01.html here].
A more general introduction of application of  the principle of least astonishment to UI design can be found [http://www.faqs.org/docs/artu/ch11s01.html here].


=== Programming ===
=== Programming ===
The principle of least astonishment also plays an important role in programming. For example, when designing libraries or API's we want meaningful function names which does what the function name implies. A very basic introduction can be found [http://c2.com/cgi/wiki?PrincipleOfLeastAstonishment here].
The principle of least astonishment also plays an important role in programming. For example, when designing libraries or API's we want meaningful function names which does what the function name implies. A very basic introduction and some examples can be found [http://c2.com/cgi/wiki?PrincipleOfLeastAstonishment here]. [http://www.atalasoft.com/cs/blogs/stevehawley/archive/2006/02/27/9590.aspx Steven's Tech Talk] has a very good introduction to proper API design using the principle of least astonishment.
 





Revision as of 17:17, 24 October 2007

Principle of Least Astonishment

The principle of least astonishment states that when you are presented with a different outcomes one should always pick the one of least ambiguity or suprise. The principle has applications in a lot of fields. This wiki serves as a guide for the reader to understand more about this principle.

Examples

The simplest example is in programming where the name of a function does not indicate its functionality.

int add(int a, int b)
{
   return (a*a+b*b);
}

The function above is supposed to add two numbers but actualy returns the sum of squares of the two numbers which would suprise the programmer who is using the function. Applying the principle of least astonishment, we can either rename the function to indicate its functionality or we can rewrite the functionality itself to correspond to its name.

int sum_of_squares(int a, int b)
{
   return (a*a+b*b);
}
int add(int a, int b)
{
   return a+b
}

Application in Programming

User interface design

The principle of least astonishment is used a lot in user interface design. Joel Spolsky has an article introducing user interface design using the principle of least astonishment. The article looks at a lot of examples of using the element of least suprise by comparing user interface design in Windows and Macintoshes.

A more general introduction of application of the principle of least astonishment to UI design can be found here.

Programming

The principle of least astonishment also plays an important role in programming. For example, when designing libraries or API's we want meaningful function names which does what the function name implies. A very basic introduction and some examples can be found here. Steven's Tech Talk has a very good introduction to proper API design using the principle of least astonishment.


Applications in Other Fields

Bibliography