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

From Expertiza_Wiki
Jump to navigation Jump to search
 
(25 intermediate revisions by the same user not shown)
Line 20: Line 20:


As can be seen in the example above, in the first example the name of the method and its functionality does not match. Whereas a better way of coding is the second one in which the functionality and the method name are related.
As can be seen in the example above, in the first example the name of the method and its functionality does not match. Whereas a better way of coding is the second one in which the functionality and the method name are related.
<br>In addition to function naming, the principle applies to user interface design. menu items and other controls. They should have an effect that is obvious and based upon their text labels and placement relative to other controls.


==Guide to the Web pages on the Principle of Least Astonishment==
==Guide to the Web pages on the Principle of Least Astonishment==
After extensive search on 'Principle of Least Astonishment' on the web, we found almost every programming discipline follows this principle. Also there are many other disciplines that applies this principle. Here are our inferences about various websites that we went through.
After extensive search on 'Principle of Least Astonishment' on the web, we found almost every programming discipline follows this principle. Also there are many other disciplines that applies this principle. Here are our inferences about various websites that we went through.


===Websites with simple examples===
===Websites with simple examples ===
Simple examples can be found at the following sites:
Simple examples can be found at the following sites:
* [http://en.wikipedia.org/wiki/Principle_of_least_astonishment User interface] This website provides a simple example on how the principle of least astonishment is applied in user interface design, programming language design, and ergonomics.
* [http://en.wikipedia.org/wiki/Principle_of_least_astonishment User interface] This website provides a simple example on how the principle of least astonishment is applied in user interface design, programming language design, and ergonomics.
* [http://www.oualline.com/style/c08.html User-Friendly Programming] This website discusses about style that one can use to include various functionality that determines how a program will look when it is used. Some good examples can be found at this site.
* [http://www.esu.edu/win_tutorial/dt_3.html The Toaster Button] This website gives an example of toaster button, and how Windows 3.11 violates the principle of least astonishment. The site lists three violations of the principle that can produce great confusion among new users.


* [http://jooto.com/blog/index.php/2006/06/06/principle-of-least-astonishment/ Yield] In this website, the author demonstrates the principle of least astonishment by giving a simple example of how to declare a template in the Rails layout section.
* [http://jooto.com/blog/index.php/2006/06/06/principle-of-least-astonishment/ Yield] In this website, the author demonstrates the principle of least astonishment by giving a simple example of how to declare a template in the Rails layout section.


*[http://benpryor.com/blog/index.php?/archives/19-API-Design-The-Principle-of-Least-Surprise.html API-Design] This website mentions that the principle of least astonishment says that using a well-designed API should be as unsurprising as possible. An API that follows the principle of least surprise conforms to the consumer’s expectations.
* [http://www.agileprogrammer.com/oneagilecoder/archive/2005/06/11/3689.aspx Whidbey System.Configuration]. In this website the author explains that how principle of least astonishment has become more of a guideline than a rule. He gives a good example of System Configuration in Visual Studio 2005.
 
<br>


===Websites with examples of applications where the principle should be used===
* [http://www.ddj.com/blog/cppblog/archives/2007/10/the_principle_o.html Finding the Signal in the Noise] This website quotes that principle of least astonishment idea is a good one most of the time. However, sometimes there is a good and simple reason for behavior that is surprising at first glance. In such cases, following the principle of least surprise may introduce extra complexity into the system and make its behavior more surprising in the long run.
* [http://www.ddj.com/blog/cppblog/archives/2007/10/the_principle_o.html Finding the Signal in the Noise] This website quotes that principle of least astonishment idea is a good one most of the time. However, sometimes there is a good and simple reason for behavior that is surprising at first glance. In such cases, following the principle of least surprise may introduce extra complexity into the system and make its behavior more surprising in the long run.


* [http://www.agileprogrammer.com/oneagilecoder/archive/2005/06/11/3689.aspx Whidbey System.Configuration]. In this website the author explains that how principle of least astonishment has become more of a guideline than a rule. He gives a good example of System Configuration in Visual Studio 2005.
*[http://benpryor.com/blog/index.php?/archives/19-API-Design-The-Principle-of-Least-Surprise.html API-Design] This website mentions that the principle of least astonishment says that using a well-designed API should be as unsurprising as possible. An API that follows the principle of least surprise conforms to the consumer’s expectations.


* [http://daniel.gredler.net/2007/05/ HtmlUnit] In this website the author mentions  about how he is using HtmlUnit to parse and interpret HTML web pages. He also claims that HtmlUnit violates the principle of least surprise.
* [http://daniel.gredler.net/2007/05/ HtmlUnit] In this website the author mentions  about how he is using HtmlUnit to parse and interpret HTML web pages. He also claims that HtmlUnit violates the principle of least surprise.
Line 40: Line 49:
* [http://www.gigascale.org/pubs/949.html Verification Through the Principle of Least Astonishment] This website gives a link to research paper which proposes a new verification methodology inspired by the principle of least astonishment. It talks about an idea to provide an automatic assessment of what constitutes "common behaviour" for a system and uses this to detect any anomaly in the design.
* [http://www.gigascale.org/pubs/949.html Verification Through the Principle of Least Astonishment] This website gives a link to research paper which proposes a new verification methodology inspired by the principle of least astonishment. It talks about an idea to provide an automatic assessment of what constitutes "common behaviour" for a system and uses this to detect any anomaly in the design.
    
    
* [http://rds.yahoo.com/_ylt=A0geu8elyyRHzhkAgUdXNyoA;_ylu=X3oDMTE5Nm0xbzlzBHNlYwNzcgRwb3MDNDkEY29sbwNhYzIEdnRpZANGNjY2Xzg5BGwDV1Mx/SIG=12c3bd7qs/EXP=1193680165/**http%3a//www.eros-os.org/papers/IEEE-Software-Jan-2002.pdf EROS: A Principle-Driven Operating System from the Ground Up] This paper talks about Extremely Reliable Operating System (EROS) and its capability to support the security and reliability needs of active systems. The paper states that this OS follows principle of least astonishment in a way that the system’s behaviour matches what is naively expected. It also states that the OS violates the principle in capability invocation specification. For complete article please refer to the link provided.
* [http://www.cincomsmalltalk.com/blog/blogView?showComments=true&entry=3258158706 How to design Good APIs] In this website, the author mentions about how to design good APIs and why they matter.  
* [http://www.cincomsmalltalk.com/blog/blogView?showComments=true&entry=3258158706 How to design Good APIs] In this website, the author mentions about how to design good APIs and why they matter.  


* [http://www.ibm.com/developerworks/web/library/us-cranky10.html Button on Visual browsers]
* [http://www.windowsitpro.com/articles/print.cfm?articleid=50239 Permission Changes Surprise Mobile Device Administrators] This website talks about, how permission changes surprises the mobile device administrators. It mentions that security is a tricky thing. There's always pressure to balance improved security against user convenience. One needs to consider factors such as backward-compatibility and the principle of least astonishment.
* [http://www.ibm.com/developerworks/web/library/us-cranky10.html Application development]
 
* [http://www.ibm.com/developerworks/web/library/us-cranky10.html Button on Visual browsers] In this website, the author mentions about how one can improve his websites. He mentions that users visits the website with some expectations, and they develop new expectations as they use the page. So one should try to meet those expectations, and try to avoid surprising them. One shpuld keep an eye out for things that could be easily misunderstood, and keep an eye out for people who haven't seen the page yet; their mistakes may reveal a design flaw you haven't seen yet.
 
* [http://ifacethoughts.net/2007/01/11/transparency-and-abstraction/ Transparency And Abstraction] This website is the web blog of Abhijit Nadgouda where he writes down his thoughts on software development and related topics.
 
* [http://rds.yahoo.com/_ylt=A0geu.8A0iRH5UUBjYdXNyoA;_ylu=X3oDMTFhamxpNzJyBHNlYwNzcgRwb3MDMTA3BGNvbG8DYWMyBHZ0aWQDRjY2Nl84OQRsA1dTMQ--/SIG=12e5jb9oi/EXP=1193681792/**http%3a//www.icann.org/presentations/seng-idn-kl-21jul04.pdf IDNA]This paper mentions how Internationalized Domain names in Applications (IDNA) uses principle of least astonishment for limiting Nameprep. Goal is to reduce confusion and to have the highest chance of getting the domain name right


<br>In addition to function naming, the principle applies to user interface design. Menu items and other controls should have an effect that is obvious based upon their text labels and placement relative to other controls.
<br>


== Principle of Least Astonishment in fields other than programming ==
=== Principle of Least Astonishment in fields other than programming ===
Principle of Least Astonishment is a very common principle that is used in every day life.
Principle of Least Astonishment is a very common principle that is used in every day life.


===Riding in Traffic===
====Riding in Traffic====
The principle of least astonishment can be translated as "ride predictably" i.e. riding in such a way that minimizes surprise. A complete article on it can be found at [http://www.mile43.com/peterson/Safety%20First.html Riding in Traffic]
The principle of least astonishment can be translated as "ride predictably" i.e. riding in such a way that minimizes surprise. A complete article on it can be found at [http://www.mile43.com/peterson/Safety%20First.html Riding in Traffic]


===Moon Walker===
====Moon Walker====
A very good article can be found at [http://www.newyorker.com/archive/2005/10/03/051003crbo_books?currentPage=1 How Neil Armstrong brought the space program down to earth]. On page 3, Armstrong mentions about principle of least astonishment.
A very good article can be found at [http://www.newyorker.com/archive/2005/10/03/051003crbo_books?currentPage=1 How Neil Armstrong brought the space program down to earth]. On page 3, Armstrong mentions about principle of least astonishment.


===Steens Mountain===
====Steens Mountain====
A decade ago, Prévot and Coe (and colleagues) reported in three papers the evidence they had found of extremely rapid changes of the Earth’s magnetic field recorded in lava flows at Steens Mountain in southern Oregon (USA). The complete article can be found at [http://www.answersingenesis.org/tj/v9/i2/astonishment.asp Steens Mountain] which describes how geomagnetists applied principle of least astonishment.
A decade ago, Prévot and Coe (and colleagues) reported in three papers the evidence they had found of extremely rapid changes of the Earth’s magnetic field recorded in lava flows at Steens Mountain in southern Oregon (USA). The complete article can be found at [http://www.answersingenesis.org/tj/v9/i2/astonishment.asp Steens Mountain] which describes how geomagnetists applied principle of least astonishment.


===Guide to writing better articles ===
====Guide to writing better articles ====
The [http://en.wikipedia.org/wiki/Wikipedia:Guide_to_writing_better_articles#Principle_of_least_astonishment Guide to writing better articles] webpage gives advice on how to write an effective article. It includes material from a number of currently or formerly separate pages into an easy to consult overview. It states that when the principle of least astonishment is successfully employed, the information is apprehended by the reader without struggle. The average reader should not be shocked, surprised, or overwhelmingly confused by the article written. For complete article refer to the link provided.
The [http://en.wikipedia.org/wiki/Wikipedia:Guide_to_writing_better_articles#Principle_of_least_astonishment Guide to writing better articles] webpage gives advice on how to write an effective article. It includes material from a number of currently or formerly separate pages into an easy to consult overview. It states that when the principle of least astonishment is successfully employed, the information is apprehended by the reader without struggle. The average reader should not be shocked, surprised, or overwhelmingly confused by the article written. For complete article refer to the link provided.


===Astrophysics===
====Astrophysics====
The [http://www.owlnet.rice.edu/~jeffreyh/LRP/intro.html Astrophysics] webpage talks about works that involved Principle of Least Astonishment in Astrophysics.
The [http://www.owlnet.rice.edu/~jeffreyh/LRP/intro.html Astrophysics] webpage talks about works that involved Principle of Least Astonishment in Astrophysics.


== See Also ==
== See Also ==
http://doodleplex.com/glassmaze/2004/10/
http://www.canonical.org/~kragen/tao-of-programming.html#book4
http://www.cs.arizona.edu/projects/sumatra/hallofshame <br>
http://www.ibm.com/developerworks/library/us-cranky10.html?dwzone=usability<br>
http://ergo.human.cornell.edu/ahtutorials/interface.html<br>
http://doodleplex.com/glassmaze/2004/10/ <br>
http://mail.gnome.org/archives/evolution-list/2007-January/msg00202.html <br>
http://ken.coar.org/burrow/index?month=2003-09#597 <br>
http://www.mssu.edu/seg-vm/bio_t__r__lafehr.html <br>
http://blogs.sun.com/swinger/entry/simple_kisses_and_surprises <br>
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/52411 <br>
http://wiki.castleproject.org/index.php/MonoRail:Brail#Principle_of_Least_Surprise <br>
http://larrytheliquid.com/ <br>
http://abhinav.livejournal.com/12862.html <br>
http://en.wikipedia.org/wiki/Talk:Principle_of_least_astonishment <br>


== References ==
== References ==
[1] http://www.faqs.org/docs/artu/ch11s01.html <br>
[1] http://www.faqs.org/docs/artu/ch11s01.html <br>
[2] http://c2.com/cgi/wiki?PrincipleOfLeastAstonishment<br>
[2] http://c2.com/cgi/wiki?PrincipleOfLeastAstonishment<br>
[3] http://www.cs.arizona.edu/projects/sumatra/hallofshame <br>
[4] http://www.ibm.com/developerworks/library/us-cranky10.html?dwzone=usability<br>
[5] http://ergo.human.cornell.edu/ahtutorials/interface.html

Latest revision as of 02:12, 30 October 2007

Principle of Least Astonishment. Write a guide to the Web pages on the Principle of Least Astonishment. Which should the reader look at for easy-to-understand examples? Which give a feel for where the principle should be used? Is this principle present in fields other than programming? Is the term used consistently in other disciplines?

Principle of Least Astonishment

The Principle of Least Astonishment states that the result of performing some operation should be obvious, consistent, and predictable, based upon the name of the operation and other clues. This axiom states that you should do your utmost to write stuff that is not going to astonish, dismay, or confuse the next person who has to look at it later. When two elements of an interface conflict or are ambiguous, the behaviour should be that which will least surprise the human user or programmer at the time the conflict arises, because the least surprising behavior will usually be the correct one.

Example

The name of a function should reflect what it does. Otherwise, a user of the function will be unpleasantly surprised: [2]

Bad design:

int calculate_salary(int days, int perday)
{
  printf("The customer has worked for %d days and his salary per day is %d dollars", a, b);
}

Better design:

int calculte_salary(int days, int perday)
{
  return days * perday;
}

As can be seen in the example above, in the first example the name of the method and its functionality does not match. Whereas a better way of coding is the second one in which the functionality and the method name are related.
In addition to function naming, the principle applies to user interface design. menu items and other controls. They should have an effect that is obvious and based upon their text labels and placement relative to other controls.

Guide to the Web pages on the Principle of Least Astonishment

After extensive search on 'Principle of Least Astonishment' on the web, we found almost every programming discipline follows this principle. Also there are many other disciplines that applies this principle. Here are our inferences about various websites that we went through.

Websites with simple examples

Simple examples can be found at the following sites:

  • User interface This website provides a simple example on how the principle of least astonishment is applied in user interface design, programming language design, and ergonomics.
  • User-Friendly Programming This website discusses about style that one can use to include various functionality that determines how a program will look when it is used. Some good examples can be found at this site.
  • The Toaster Button This website gives an example of toaster button, and how Windows 3.11 violates the principle of least astonishment. The site lists three violations of the principle that can produce great confusion among new users.
  • Yield In this website, the author demonstrates the principle of least astonishment by giving a simple example of how to declare a template in the Rails layout section.
  • Whidbey System.Configuration. In this website the author explains that how principle of least astonishment has become more of a guideline than a rule. He gives a good example of System Configuration in Visual Studio 2005.


Websites with examples of applications where the principle should be used

  • Finding the Signal in the Noise This website quotes that principle of least astonishment idea is a good one most of the time. However, sometimes there is a good and simple reason for behavior that is surprising at first glance. In such cases, following the principle of least surprise may introduce extra complexity into the system and make its behavior more surprising in the long run.
  • API-Design This website mentions that the principle of least astonishment says that using a well-designed API should be as unsurprising as possible. An API that follows the principle of least surprise conforms to the consumer’s expectations.
  • HtmlUnit In this website the author mentions about how he is using HtmlUnit to parse and interpret HTML web pages. He also claims that HtmlUnit violates the principle of least surprise.
  • Verification Through the Principle of Least Astonishment This website gives a link to research paper which proposes a new verification methodology inspired by the principle of least astonishment. It talks about an idea to provide an automatic assessment of what constitutes "common behaviour" for a system and uses this to detect any anomaly in the design.
  • EROS: A Principle-Driven Operating System from the Ground Up This paper talks about Extremely Reliable Operating System (EROS) and its capability to support the security and reliability needs of active systems. The paper states that this OS follows principle of least astonishment in a way that the system’s behaviour matches what is naively expected. It also states that the OS violates the principle in capability invocation specification. For complete article please refer to the link provided.
  • Permission Changes Surprise Mobile Device Administrators This website talks about, how permission changes surprises the mobile device administrators. It mentions that security is a tricky thing. There's always pressure to balance improved security against user convenience. One needs to consider factors such as backward-compatibility and the principle of least astonishment.
  • Button on Visual browsers In this website, the author mentions about how one can improve his websites. He mentions that users visits the website with some expectations, and they develop new expectations as they use the page. So one should try to meet those expectations, and try to avoid surprising them. One shpuld keep an eye out for things that could be easily misunderstood, and keep an eye out for people who haven't seen the page yet; their mistakes may reveal a design flaw you haven't seen yet.
  • Transparency And Abstraction This website is the web blog of Abhijit Nadgouda where he writes down his thoughts on software development and related topics.
  • IDNAThis paper mentions how Internationalized Domain names in Applications (IDNA) uses principle of least astonishment for limiting Nameprep. Goal is to reduce confusion and to have the highest chance of getting the domain name right



Principle of Least Astonishment in fields other than programming

Principle of Least Astonishment is a very common principle that is used in every day life.

Riding in Traffic

The principle of least astonishment can be translated as "ride predictably" i.e. riding in such a way that minimizes surprise. A complete article on it can be found at Riding in Traffic

Moon Walker

A very good article can be found at How Neil Armstrong brought the space program down to earth. On page 3, Armstrong mentions about principle of least astonishment.

Steens Mountain

A decade ago, Prévot and Coe (and colleagues) reported in three papers the evidence they had found of extremely rapid changes of the Earth’s magnetic field recorded in lava flows at Steens Mountain in southern Oregon (USA). The complete article can be found at Steens Mountain which describes how geomagnetists applied principle of least astonishment.

Guide to writing better articles

The Guide to writing better articles webpage gives advice on how to write an effective article. It includes material from a number of currently or formerly separate pages into an easy to consult overview. It states that when the principle of least astonishment is successfully employed, the information is apprehended by the reader without struggle. The average reader should not be shocked, surprised, or overwhelmingly confused by the article written. For complete article refer to the link provided.

Astrophysics

The Astrophysics webpage talks about works that involved Principle of Least Astonishment in Astrophysics.

See Also

http://www.canonical.org/~kragen/tao-of-programming.html#book4 http://www.cs.arizona.edu/projects/sumatra/hallofshame
http://www.ibm.com/developerworks/library/us-cranky10.html?dwzone=usability
http://ergo.human.cornell.edu/ahtutorials/interface.html
http://doodleplex.com/glassmaze/2004/10/
http://mail.gnome.org/archives/evolution-list/2007-January/msg00202.html
http://ken.coar.org/burrow/index?month=2003-09#597
http://www.mssu.edu/seg-vm/bio_t__r__lafehr.html
http://blogs.sun.com/swinger/entry/simple_kisses_and_surprises
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/52411
http://wiki.castleproject.org/index.php/MonoRail:Brail#Principle_of_Least_Surprise
http://larrytheliquid.com/
http://abhinav.livejournal.com/12862.html
http://en.wikipedia.org/wiki/Talk:Principle_of_least_astonishment

References

[1] http://www.faqs.org/docs/artu/ch11s01.html
[2] http://c2.com/cgi/wiki?PrincipleOfLeastAstonishment