User Tools

Site Tools


principles:easy_to_use_and_hard_to_misuse

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
principles:easy_to_use_and_hard_to_misuse [2013-04-03 16:43] – [Further Reading] christianprinciples:easy_to_use_and_hard_to_misuse [2013-05-19 22:09] – external edit 127.0.0.1
Line 12: Line 12:
  
 A module shall be easy to use and hard to misuse. A module shall be easy to use and hard to misuse.
 +
  
 ===== Description ===== ===== Description =====
 +
 +A module is easy to use when the obvious way of using it is correct, when following established conventions means to use it correctly and the identifier of the module hints the correct usage. A module is hard to misuse, if misusing it requires more work than correct usage and when the compiler signals wrong usages.
  
  
 ===== Rationale ===== ===== Rationale =====
 +
 +This principle is common wisdom among API designers. APIs are used by many people and mainly by those who have not implemented the API. Few people read the documentation and will just try to use an API the obvious way. If the obvious way of using it is correct, if the API is easy to use, development will be more efficient. Furthermore if an API is hard to misuse, fewer mistakes will be made and which decreases the need for debugging and improves code quality.
 +
 +The same reasoning holds for every module, not just APIs. There are always other developers who will use a module. Either team members or successors. Moreover after a while one will not remember the details of a module anymore, the difference between other people and oneself will vanish. This means EUHM not only holds for APIs and not only for interfaces provided to the other team members but it holds for every single module.
  
  
Line 37: Line 44:
  
 ===== Origin ===== ===== Origin =====
 +
 +The precise origin of the principle is unknown.
  
  
 ===== Evidence ===== ===== Evidence =====
 /* Comment out what is not applicable and explain the rest: */ /* Comment out what is not applicable and explain the rest: */
-/* + 
-  [[wiki:Proposed]] +[[wiki:Proposed]] 
-  * [[wiki:Examined]]+ 
 +/*  * [[wiki:Examined]]
   * [[wiki:Accepted]]   * [[wiki:Accepted]]
   * [[wiki:Questioned]]   * [[wiki:Questioned]]
Line 77: Line 87:
 ===== Description Status ===== ===== Description Status =====
 /* Choose one of the following and comment out the rest: */ /* Choose one of the following and comment out the rest: */
-[[wiki:Stub]] +/*[[wiki:Stub]]*
-/*[[wiki:Incomplete]]*/+[[wiki:Incomplete]]
 /*[[wiki:Complete]]*/ /*[[wiki:Complete]]*/
  
principles/easy_to_use_and_hard_to_misuse.txt · Last modified: 2021-10-18 21:29 by christian