<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://commons.oreilly.com/wiki/skins/common/feed.css?97"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;action=history&amp;feed=atom</id>
		<title>Make Interfaces Easy to Use Correctly and Hard to Use Incorrectly - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;action=history&amp;feed=atom"/>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;action=history"/>
		<updated>2013-05-23T18:39:34Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.11.0</generator>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=24663&amp;oldid=prev</id>
		<title>Kevlin at 12:21, 7 July 2009</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=24663&amp;oldid=prev"/>
				<updated>2009-07-07T12:21:29Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 12:21, 7 July 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Above all, remember that interfaces exist for the convenience of their users, not their implementers.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Above all, remember that interfaces exist for the convenience of their users, not their implementers.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;By [[Scott Meyers]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;This work is licensed under a [http://creativecommons.org/licenses/by/3.0/us/ Creative Commons Attribution 3] &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Back to [[97 Things Every Programmer Should Know]] home page&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikicontent:diff:version:1.11a:oldid:21675:newid:24663 --&gt;
&lt;/table&gt;</summary>
		<author><name>Kevlin</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=21675&amp;oldid=prev</id>
		<title>Kevlin at 16:00, 22 November 2008</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=21675&amp;oldid=prev"/>
				<updated>2008-11-22T16:00:32Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 16:00, 22 November 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;One of the most common tasks in software development is interface specification. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;Interfaces occur at the highest level of abstraction (user interfaces), at the lowest (function interfaces), and at levels in between (class interfaces, library interfaces, etc.). &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;Regardless of whether you work  with end users to specify how they'll interact with a system,  collaborate with developers to specify an API, or declare functions private to a class, interface design is an important part of your job. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;If you do it well, your interfaces will be a pleasure to use and will boost others' productivity. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;If you do it poorly, your interfaces will be a source of frustration and errors.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;One of the most common tasks in software development is interface specification. Interfaces occur at the highest level of abstraction (user interfaces), at the lowest (function interfaces), and at levels in between (class interfaces, library interfaces, etc.). Regardless of whether you work  with end users to specify how they'll interact with a system,  collaborate with developers to specify an API, or declare functions private to a class, interface design is an important part of your job. If you do it well, your interfaces will be a pleasure to use and will boost others' productivity. If you do it poorly, your interfaces will be a source of frustration and errors.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Good interfaces are:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Good interfaces are:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Easy to use correctly.''' &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;People using a well-designed interface almost always use the interface correctly, because that's the path of least resistance. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;In a GUI, they almost always click on the right icon, button, or menu entry, because it's the obvious and easy thing to do. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;In an API, they almost always pass the correct parameters with the correct values, because that's what's most natural. With interfaces that are easy to use correctly, ''things just work.''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Easy to use correctly.''' People using a well-designed interface almost always use the interface correctly, because that's the path of least resistance. In a GUI, they almost always click on the right icon, button, or menu entry, because it's the obvious and easy thing to do. In an API, they almost always pass the correct parameters with the correct values, because that's what's most natural. With interfaces that are easy to use correctly, ''things just work.''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Hard to use incorrectly.''' &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;Good interfaces anticipate mistakes people might make and make them difficult &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;-- &lt;/del&gt;ideally impossible &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;-- &lt;/del&gt;to commit. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;A GUI might disable or remove commands that make no sense in the current context, for example, or an API might eliminate argument-ordering problems by allowing parameters to be passed in any order.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Hard to use incorrectly.''' Good interfaces anticipate mistakes people might make and make them difficult &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;mdash; &lt;/ins&gt;ideally impossible &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;mdash; &lt;/ins&gt;to commit. A GUI might disable or remove commands that make no sense in the current context, for example, or an API might eliminate argument-ordering problems by allowing parameters to be passed in any order.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A good way to design interfaces that are easy to use correctly is to exercise them before they exist. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;Mock up a GUI &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;-- &lt;/del&gt;possibly on a whiteboard or using index cards on a table &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;-- &lt;/del&gt;and play with it before any underlying code has been created.  Write calls to an API before the functions have been declared. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;Walk through common use cases and specify how you ''want'' the interface to behave. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;What do you ''want'' to be able to click on? &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;What do you ''want'' to be able to pass? &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;Easy to use interfaces seem natural, because they let you  do what you want to do. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;You're more likely to come up with such interfaces if you develop them from a user's point of view. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;(This perspective is one of the strengths of test-first programming.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A good way to design interfaces that are easy to use correctly is to exercise them before they exist. Mock up a GUI &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;mdash; &lt;/ins&gt;possibly on a whiteboard or using index cards on a table &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;mdash; &lt;/ins&gt;and play with it before any underlying code has been created.  Write calls to an API before the functions have been declared. Walk through common use cases and specify how you ''want'' the interface to behave. What do you ''want'' to be able to click on? What do you ''want'' to be able to pass? Easy to use interfaces seem natural, because they let you  do what you want to do. You're more likely to come up with such interfaces if you develop them from a user's point of view. (This perspective is one of the strengths of test-first programming.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making interfaces hard to use incorrectly requires two things. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;First, you must anticipate errors users might make and find ways to prevent them. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;Second, you must observe how an interface is misused during early release and modify the interface &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;-- &lt;/del&gt;yes, modify the interface! &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;-- &lt;/del&gt;to prevent such errors. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;The best way to prevent incorrect use is to make such use impossible. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;If users keep wanting to undo an irrevocable action, try to make the action revocable. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;If they keep passing the wrong value to an API, do your best to modify the API to take the values that users want to pass.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making interfaces hard to use incorrectly requires two things. First, you must anticipate errors users might make and find ways to prevent them. Second, you must observe how an interface is misused during early release and modify the interface &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;mdash; &lt;/ins&gt;yes, modify the interface! &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;mdash; &lt;/ins&gt;to prevent such errors. The best way to prevent incorrect use is to make such use impossible. If users keep wanting to undo an irrevocable action, try to make the action revocable. If they keep passing the wrong value to an API, do your best to modify the API to take the values that users want to pass.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Above all, remember that interfaces exist for the convenience of their users, not their implementers.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Above all, remember that interfaces exist for the convenience of their users, not their implementers.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Kevlin</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=12970&amp;oldid=prev</id>
		<title>ScottMeyers at 02:27, 11 November 2008</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=12970&amp;oldid=prev"/>
				<updated>2008-11-11T02:27:10Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 02:27, 11 November 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;One of the most common tasks in software development is interface specification.  Interfaces occur at the highest level of abstraction (user interfaces), at the lowest (function interfaces), and at levels in between (class interfaces, library interfaces, etc.).  Regardless of whether you work  with end users to specify how they'll interact with a system,  collaborate with developers to specify an API, or declare functions private to a class, interface design is an important part of your job.  If you do it well, your interfaces will be a pleasure to use and will &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;actually &lt;/del&gt;boost productivity.  If you do it poorly, your interfaces will be a source of frustration and errors.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;One of the most common tasks in software development is interface specification.  Interfaces occur at the highest level of abstraction (user interfaces), at the lowest (function interfaces), and at levels in between (class interfaces, library interfaces, etc.).  Regardless of whether you work  with end users to specify how they'll interact with a system,  collaborate with developers to specify an API, or declare functions private to a class, interface design is an important part of your job.  If you do it well, your interfaces will be a pleasure to use and will boost &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;others' &lt;/ins&gt;productivity.  If you do it poorly, your interfaces will be a source of frustration and errors.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Good interfaces are:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Good interfaces are:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Hard to use incorrectly.'''  Good interfaces anticipate mistakes people might make and make them difficult -- ideally impossible -- to commit.  A GUI might disable or remove commands that make no sense in the current context, for example, or an API might eliminate argument-ordering problems by allowing parameters to be passed in any order.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Hard to use incorrectly.'''  Good interfaces anticipate mistakes people might make and make them difficult -- ideally impossible -- to commit.  A GUI might disable or remove commands that make no sense in the current context, for example, or an API might eliminate argument-ordering problems by allowing parameters to be passed in any order.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A good way to design interfaces that are easy to use correctly is to exercise them before they exist.  Mock up a GUI -- possibly on a whiteboard or using index cards on a table -- and play with it before &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the &lt;/del&gt;underlying code has been created.  Write calls to an API before the functions have been declared.  Walk through common use cases and specify how you ''want'' the interface to behave.  What do you ''want'' to be able to click on?  What do you ''want'' to be able to pass?  Easy to use interfaces seem natural, because they let you  do what you want to do.  You're more likely to come up with such interfaces if you develop them from a user's point of view.  (This perspective is one of the strengths of test-first programming.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A good way to design interfaces that are easy to use correctly is to exercise them before they exist.  Mock up a GUI -- possibly on a whiteboard or using index cards on a table -- and play with it before &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;any &lt;/ins&gt;underlying code has been created.  Write calls to an API before the functions have been declared.  Walk through common use cases and specify how you ''want'' the interface to behave.  What do you ''want'' to be able to click on?  What do you ''want'' to be able to pass?  Easy to use interfaces seem natural, because they let you  do what you want to do.  You're more likely to come up with such interfaces if you develop them from a user's point of view.  (This perspective is one of the strengths of test-first programming.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making interfaces hard to use incorrectly requires two things.  First, you must anticipate errors users might make and find ways to prevent them.  Second, you must observe how an interface is misused during early release and modify the interface -- yes, modify the interface! -- to prevent such errors.  The best way to prevent incorrect use is to make such use impossible.  If users keep wanting to undo an irrevocable action, try to make the action revocable.  If they keep passing the wrong value to an API, do your best to modify the API to take the values that users want to pass.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making interfaces hard to use incorrectly requires two things.  First, you must anticipate errors users might make and find ways to prevent them.  Second, you must observe how an interface is misused during early release and modify the interface -- yes, modify the interface! -- to prevent such errors.  The best way to prevent incorrect use is to make such use impossible.  If users keep wanting to undo an irrevocable action, try to make the action revocable.  If they keep passing the wrong value to an API, do your best to modify the API to take the values that users want to pass.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Above all, remember that interfaces exist for the convenience of their users, not their implementers.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Above all, remember that interfaces exist for the convenience of their users, not their implementers.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>ScottMeyers</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=12969&amp;oldid=prev</id>
		<title>ScottMeyers at 02:20, 11 November 2008</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=12969&amp;oldid=prev"/>
				<updated>2008-11-11T02:20:55Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 02:20, 11 November 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;One of the most common tasks in software development is interface specification.  Interfaces occur at the highest level of abstraction (user interfaces), at the lowest (function interfaces), and at levels in between (class interfaces, library &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;interfaces, package &lt;/del&gt;interfaces, etc.).  Regardless of whether you work  with end users to specify how they'll interact with a system &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;under design&lt;/del&gt;,  collaborate with &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;other &lt;/del&gt;developers to specify an API, or declare functions private to a class &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;you're working on&lt;/del&gt;, interface design is an important part of your job.  If you do it well, your interfaces will be a pleasure to use and will actually boost productivity.  If you do it poorly, your interfaces will be a source of frustration and errors.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;One of the most common tasks in software development is interface specification.  Interfaces occur at the highest level of abstraction (user interfaces), at the lowest (function interfaces), and at levels in between (class interfaces, library interfaces, etc.).  Regardless of whether you work  with end users to specify how they'll interact with a system,  collaborate with developers to specify an API, or declare functions private to a class, interface design is an important part of your job.  If you do it well, your interfaces will be a pleasure to use and will actually boost productivity.  If you do it poorly, your interfaces will be a source of frustration and errors.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Good interfaces are:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Good interfaces are:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Easy to use correctly.'''  People using a well-designed interface almost always use the interface correctly, because that's the path of least resistance.  In a GUI, they almost always click on the right icon, button, or menu entry, because it's the obvious and easy thing to do.  In an API, they almost always pass the correct parameters with the correct &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;types and &lt;/del&gt;values, because&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, again, it&lt;/del&gt;'s &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;obvious and easy&lt;/del&gt;. With interfaces that are easy to use correctly, ''things just work.''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Easy to use correctly.'''  People using a well-designed interface almost always use the interface correctly, because that's the path of least resistance.  In a GUI, they almost always click on the right icon, button, or menu entry, because it's the obvious and easy thing to do.  In an API, they almost always pass the correct parameters with the correct values, because &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;that's what&lt;/ins&gt;'s &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;most natural&lt;/ins&gt;. With interfaces that are easy to use correctly, ''things just work.''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Hard to use incorrectly.'''  Good interfaces anticipate mistakes people might make&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/del&gt;and &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;they &lt;/del&gt;make them difficult -- ideally impossible -- to commit.  A GUI might disable or remove commands that make no sense in the current context, for example, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;and &lt;/del&gt;an API might &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;allow &lt;/del&gt;parameters to be passed in any order &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;to eliminate argument-ordering problems&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Hard to use incorrectly.'''  Good interfaces anticipate mistakes people might make and make them difficult -- ideally impossible -- to commit.  A GUI might disable or remove commands that make no sense in the current context, for example, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;or &lt;/ins&gt;an API might &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;eliminate argument-ordering problems by allowing &lt;/ins&gt;parameters to be passed in any order.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A good way to design interfaces that are easy to use correctly is to &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''&lt;/del&gt;exercise them before they exist&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''&lt;/del&gt;.  Mock up a GUI -- possibly on a whiteboard or using index cards on a table -- and play with it before &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;any of &lt;/del&gt;the underlying code has been created.  Write calls to an API before the functions have been declared.  Walk through common use cases and specify how you ''want'' the interface to behave.  What do you ''want'' to be able to click on?  What do you ''want'' to be able to pass?  Easy to use interfaces seem natural, because they let you  do what you want to do.  You're more likely to come up with such interfaces if you develop them from &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the &lt;/del&gt;user's point of view.  (This perspective is one of the strengths of test-first programming.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A good way to design interfaces that are easy to use correctly is to exercise them before they exist.  Mock up a GUI -- possibly on a whiteboard or using index cards on a table -- and play with it before the underlying code has been created.  Write calls to an API before the functions have been declared.  Walk through common use cases and specify how you ''want'' the interface to behave.  What do you ''want'' to be able to click on?  What do you ''want'' to be able to pass?  Easy to use interfaces seem natural, because they let you  do what you want to do.  You're more likely to come up with such interfaces if you develop them from &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;a &lt;/ins&gt;user's point of view.  (This perspective is one of the strengths of test-first programming.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making interfaces hard to use incorrectly requires two things.  First, you must anticipate errors users might &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;inadvertently &lt;/del&gt;make and find ways to prevent them.  Second, you must observe how an interface is misused during early release and modify the interface -- yes, modify the interface! -- to prevent such errors &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;before wider deployment&lt;/del&gt;.  The best way to prevent incorrect use is to make such use impossible.  If users keep wanting to undo an irrevocable action, try to make the action revocable.  If they keep passing the wrong value to an API, do your best to modify the API to take the values users want to pass.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making interfaces hard to use incorrectly requires two things.  First, you must anticipate errors users might make and find ways to prevent them.  Second, you must observe how an interface is misused during early release and modify the interface -- yes, modify the interface! -- to prevent such errors.  The best way to prevent incorrect use is to make such use impossible.  If users keep wanting to undo an irrevocable action, try to make the action revocable.  If they keep passing the wrong value to an API, do your best to modify the API to take the values &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;that &lt;/ins&gt;users want to pass.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Above all, remember that interfaces exist for the convenience of their users, not their implementers.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Above all, remember that interfaces exist for the convenience of their users, not their implementers.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>ScottMeyers</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=12968&amp;oldid=prev</id>
		<title>ScottMeyers at 01:25, 11 November 2008</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=12968&amp;oldid=prev"/>
				<updated>2008-11-11T01:25:03Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 01:25, 11 November 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;One of the most common tasks in software development is interface specification.  Interfaces occur at the highest level of abstraction (user interfaces), at the lowest (function interfaces), and at &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;numerous &lt;/del&gt;levels in between (class interfaces, library interfaces, package interfaces, etc.).  Regardless of whether you work  with end users to specify how they'll interact with a system under design,  &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;work &lt;/del&gt;with other developers to specify an API, or declare functions private to a class you're working on, interface design is an important part of your job.  If you do it well, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the resulting &lt;/del&gt;interfaces will be a pleasure to use and will actually boost productivity.  If you do it poorly, your interfaces will be a source of frustration and errors.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;One of the most common tasks in software development is interface specification.  Interfaces occur at the highest level of abstraction (user interfaces), at the lowest (function interfaces), and at levels in between (class interfaces, library interfaces, package interfaces, etc.).  Regardless of whether you work  with end users to specify how they'll interact with a system under design,  &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;collaborate &lt;/ins&gt;with other developers to specify an API, or declare functions private to a class you're working on, interface design is an important part of your job.  If you do it well, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;your &lt;/ins&gt;interfaces will be a pleasure to use and will actually boost productivity.  If you do it poorly, your interfaces will be a source of frustration and errors.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Good interfaces &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;have two crucial characteristics&lt;/del&gt;:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Good interfaces &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;are&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;They're easy &lt;/del&gt;to use correctly.'''  People using a well-designed interface almost always use the interface correctly, because that's the path of least resistance.  In a GUI, they almost always click on the right icon, button, or menu entry, because it's the obvious and easy thing to do.  In an API, they almost always pass the correct parameters with the correct types and values, because, again, it's obvious and easy. With interfaces that are easy to use correctly, ''things just work.''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Easy &lt;/ins&gt;to use correctly.'''  People using a well-designed interface almost always use the interface correctly, because that's the path of least resistance.  In a GUI, they almost always click on the right icon, button, or menu entry, because it's the obvious and easy thing to do.  In an API, they almost always pass the correct parameters with the correct types and values, because, again, it's obvious and easy. With interfaces that are easy to use correctly, ''things just work.''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;They're hard &lt;/del&gt;to use incorrectly.'''  Good interfaces anticipate mistakes people might make, and they make them difficult -- ideally impossible -- to commit.  A GUI might disable or remove commands that make no sense in the current context, for example, and an API might allow parameters to be passed in any order to eliminate &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;parameters passed out of order&amp;quot; &lt;/del&gt;problems.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Hard &lt;/ins&gt;to use incorrectly.'''  Good interfaces anticipate mistakes people might make, and they make them difficult -- ideally impossible -- to commit.  A GUI might disable or remove commands that make no sense in the current context, for example, and an API might allow parameters to be passed in any order to eliminate &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;argument-ordering &lt;/ins&gt;problems.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A good way to design interfaces that are easy to use correctly is to ''exercise them before they exist''.  Mock up a GUI -- possibly on a whiteboard or using index cards on a table -- and play with it before any of the underlying code has been created.  Write calls to an API before &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;any of &lt;/del&gt;the functions have been declared.  Walk through &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;various &lt;/del&gt;common use cases and specify how you ''want'' the interface to behave.  What do you ''want'' to be able to click on?  What do you ''want'' to be able to pass?  Easy to use interfaces seem natural, because they let you  do what you want to do.  You're more likely to come up with such interfaces if you develop them from the user's point of view.  (&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Such a &lt;/del&gt;perspective is one of the strengths of test-first programming.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A good way to design interfaces that are easy to use correctly is to ''exercise them before they exist''.  Mock up a GUI -- possibly on a whiteboard or using index cards on a table -- and play with it before any of the underlying code has been created.  Write calls to an API before the functions have been declared.  Walk through common use cases and specify how you ''want'' the interface to behave.  What do you ''want'' to be able to click on?  What do you ''want'' to be able to pass?  Easy to use interfaces seem natural, because they let you  do what you want to do.  You're more likely to come up with such interfaces if you develop them from the user's point of view.  (&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;This &lt;/ins&gt;perspective is one of the strengths of test-first programming.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making interfaces hard to use incorrectly requires two things.  First, you must &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''&lt;/del&gt;anticipate errors &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;that &lt;/del&gt;users might inadvertently make&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;,'' &lt;/del&gt;and &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;you must &lt;/del&gt;find ways to prevent &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;such errors&lt;/del&gt;.  Second, you must &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''&lt;/del&gt;observe how &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the &lt;/del&gt;interface is misused&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;'' &lt;/del&gt;during early release&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/del&gt;and &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;you must be willing to &lt;/del&gt;modify the interface -- yes, modify the interface! -- to prevent such errors before &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;deploying the interface further&lt;/del&gt;.  The best way to prevent incorrect use is to make such use impossible.  If users keep wanting to undo an irrevocable action, make the action revocable&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;! &lt;/del&gt; If they keep passing the wrong value to an API, modify the API to take the &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;kind of value &lt;/del&gt;users want to pass&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;!  &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making interfaces hard to use incorrectly requires two things.  First, you must anticipate errors users might inadvertently make and find ways to prevent &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;them&lt;/ins&gt;.  Second, you must observe how &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;an &lt;/ins&gt;interface is misused during early release and modify the interface -- yes, modify the interface! -- to prevent such errors before &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;wider deployment&lt;/ins&gt;.  The best way to prevent incorrect use is to make such use impossible.  If users keep wanting to undo an irrevocable action, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;try to &lt;/ins&gt;make the action revocable&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;. &lt;/ins&gt; If they keep passing the wrong value to an API, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;do your best to &lt;/ins&gt;modify the API to take the &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;values &lt;/ins&gt;users want to pass&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Above all, remember that interfaces exist for the convenience of their users, not their implementers.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Above all, remember that interfaces exist for the convenience of their users, not their implementers.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>ScottMeyers</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=12967&amp;oldid=prev</id>
		<title>ScottMeyers at 00:01, 11 November 2008</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=12967&amp;oldid=prev"/>
				<updated>2008-11-11T00:01:11Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 00:01, 11 November 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A good way to design interfaces that are easy to use correctly is to ''exercise them before they exist''.  Mock up a GUI -- possibly on a whiteboard or using index cards on a table -- and play with it before any of the underlying code has been created.  Write calls to an API before any of the functions have been declared.  Walk through various common use cases and specify how you ''want'' the interface to behave.  What do you ''want'' to be able to click on?  What do you ''want'' to be able to pass?  Easy to use interfaces seem natural, because they let you  do what you want to do.  You're more likely to come up with such interfaces if you develop them from the user's point of view.  (Such a perspective is one of the strengths of test-first programming.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A good way to design interfaces that are easy to use correctly is to ''exercise them before they exist''.  Mock up a GUI -- possibly on a whiteboard or using index cards on a table -- and play with it before any of the underlying code has been created.  Write calls to an API before any of the functions have been declared.  Walk through various common use cases and specify how you ''want'' the interface to behave.  What do you ''want'' to be able to click on?  What do you ''want'' to be able to pass?  Easy to use interfaces seem natural, because they let you  do what you want to do.  You're more likely to come up with such interfaces if you develop them from the user's point of view.  (Such a perspective is one of the strengths of test-first programming.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making interfaces hard to use incorrectly requires two things.  First, you must ''anticipate errors that users might inadvertently make,'' and you must find ways to prevent such errors.  Second, you must ''observe how the interface is misused'' during early release, and you must be willing to modify the interface -- yes, modify the interface! -- to prevent such errors before deploying the interface further.  The best way to prevent incorrect use is to make &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;it &lt;/del&gt;impossible.  If users keep wanting to undo an irrevocable action, make &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;it &lt;/del&gt;revocable!  If they keep passing the wrong value to an API, modify the API to take the kind of value users want to pass!  &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Interfaces &lt;/del&gt;exist for the convenience of their users, not their implementers.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making interfaces hard to use incorrectly requires two things.  First, you must ''anticipate errors that users might inadvertently make,'' and you must find ways to prevent such errors.  Second, you must ''observe how the interface is misused'' during early release, and you must be willing to modify the interface -- yes, modify the interface! -- to prevent such errors before deploying the interface further.  The best way to prevent incorrect use is to make &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;such use &lt;/ins&gt;impossible.  If users keep wanting to undo an irrevocable action, make &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the action &lt;/ins&gt;revocable!  If they keep passing the wrong value to an API, modify the API to take the kind of value users want to pass!  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Above all, remember that interfaces &lt;/ins&gt;exist for the convenience of their users, not their implementers.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>ScottMeyers</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=12966&amp;oldid=prev</id>
		<title>ScottMeyers at 23:59, 10 November 2008</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=12966&amp;oldid=prev"/>
				<updated>2008-11-10T23:59:18Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 23:59, 10 November 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A good way to design interfaces that are easy to use correctly is to ''exercise them before they exist''.  Mock up a GUI -- possibly on a whiteboard or using index cards on a table -- and play with it before any of the underlying code has been created.  Write calls to an API before any of the functions have been declared.  Walk through various common use cases and specify how you ''want'' the interface to behave.  What do you ''want'' to be able to click on?  What do you ''want'' to be able to pass?  Easy to use interfaces seem natural, because they let you  do what you want to do.  You're more likely to come up with such interfaces if you develop them from the user's point of view.  (Such a perspective is one of the strengths of test-first programming.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A good way to design interfaces that are easy to use correctly is to ''exercise them before they exist''.  Mock up a GUI -- possibly on a whiteboard or using index cards on a table -- and play with it before any of the underlying code has been created.  Write calls to an API before any of the functions have been declared.  Walk through various common use cases and specify how you ''want'' the interface to behave.  What do you ''want'' to be able to click on?  What do you ''want'' to be able to pass?  Easy to use interfaces seem natural, because they let you  do what you want to do.  You're more likely to come up with such interfaces if you develop them from the user's point of view.  (Such a perspective is one of the strengths of test-first programming.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making interfaces hard to use incorrectly requires two things.  First, you must ''anticipate errors that users might inadvertently make,'' and you must find ways to prevent such errors.  Second, you must ''observe how the interface is misused'' during early release, and you must be willing to modify the interface -- yes, modify the interface! -- to prevent such errors before deploying the interface further.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making interfaces hard to use incorrectly requires two things.  First, you must ''anticipate errors that users might inadvertently make,'' and you must find ways to prevent such errors.  Second, you must ''observe how the interface is misused'' during early release, and you must be willing to modify the interface -- yes, modify the interface! -- to prevent such errors before deploying the interface further&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;.  The best way to prevent incorrect use is to make it impossible.  If users keep wanting to undo an irrevocable action, make it revocable!  If they keep passing the wrong value to an API, modify the API to take the kind of value users want to pass!  Interfaces exist for the convenience of their users, not their implementers&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikicontent:diff:version:1.11a:oldid:12965:newid:12966 --&gt;
&lt;/table&gt;</summary>
		<author><name>ScottMeyers</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=12965&amp;oldid=prev</id>
		<title>ScottMeyers at 23:55, 10 November 2008</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=12965&amp;oldid=prev"/>
				<updated>2008-11-10T23:55:24Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 23:55, 10 November 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;One of the most common tasks &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;undertaken during &lt;/del&gt;software development is interface specification.  Interfaces occur at the highest level of abstraction (user interfaces), at the lowest (function interfaces), and at numerous levels in between (class interfaces, library interfaces, package interfaces, etc.).  Regardless of whether you&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;'re working &lt;/del&gt;with end users to specify how they'll interact with a system under design, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;working &lt;/del&gt;with other developers to specify an API, or &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;declaring &lt;/del&gt;functions private to a class you're working on, interface design &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;will be &lt;/del&gt;an important part of your job.  If you do it well, the resulting interfaces will be a pleasure to use and will actually boost productivity.  If you do it poorly, your interfaces will be a &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;constant &lt;/del&gt;source of frustration and errors.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;One of the most common tasks &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;in &lt;/ins&gt;software development is interface specification.  Interfaces occur at the highest level of abstraction (user interfaces), at the lowest (function interfaces), and at numerous levels in between (class interfaces, library interfaces, package interfaces, etc.).  Regardless of whether you &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;work  &lt;/ins&gt;with end users to specify how they'll interact with a system under design, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; work &lt;/ins&gt;with other developers to specify an API, or &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;declare &lt;/ins&gt;functions private to a class you're working on, interface design &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;is &lt;/ins&gt;an important part of your job.  If you do it well, the resulting interfaces will be a pleasure to use and will actually boost productivity.  If you do it poorly, your interfaces will be a source of frustration and errors.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Good interfaces have two crucial characteristics:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Good interfaces have two crucial characteristics:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''They're easy to use correctly.'''  People using a well-designed interface almost always use the interface correctly, because that's the path of least resistance.  In a GUI, they almost always click on the right icon, button, or menu entry, because it's the &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;most &lt;/del&gt;obvious and easy thing to do.  In an API, they almost always pass the correct parameters with the correct types and values, because, again, it's &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the most &lt;/del&gt;obvious and easy &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;thing to do&lt;/del&gt;. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;With interfaces that are easy to use correctly, ''things just work.''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''They're easy to use correctly.'''  People using a well-designed interface almost always use the interface correctly, because that's the path of least resistance.  In a GUI, they almost always click on the right icon, button, or menu entry, because it's the obvious and easy thing to do.  In an API, they almost always pass the correct parameters with the correct types and values, because, again, it's obvious and easy. With interfaces that are easy to use correctly, ''things just work.''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''They're hard to use incorrectly.'''  Good interfaces &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;are designed to &lt;/del&gt;anticipate &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the kinds of &lt;/del&gt;mistakes people might make and &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;to &lt;/del&gt;make them difficult -- ideally impossible -- to commit.  A GUI might disable or remove commands that make no sense in the current context, for example, and an API might allow parameters to be passed in any order to eliminate &amp;quot;parameters passed out of order&amp;quot; problems.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''They're hard to use incorrectly.'''  Good interfaces anticipate mistakes people might make&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;and &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;they &lt;/ins&gt;make them difficult -- ideally impossible -- to commit.  A GUI might disable or remove commands that make no sense in the current context, for example, and an API might allow parameters to be passed in any order to eliminate &amp;quot;parameters passed out of order&amp;quot; problems.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;One of the best ways &lt;/del&gt;to design interfaces that are easy to use correctly is to ''exercise them before they exist''.  &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;That is, mock &lt;/del&gt;up a GUI -- possibly on a whiteboard or using index cards on a table -- and play with it before any of the underlying code has been created.  Write calls to an API before any of the functions have been declared.  Walk through various common use cases and specify how you ''want'' the interface to behave.  What do you ''want'' to be able to click on?  What do you ''want'' to be able to pass?  Easy to use interfaces seem natural, because they let you &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;-- they ''encourage'' you -- to &lt;/del&gt;do what you want to do.  You're more likely to come up with such interfaces if&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, from the get-go, &lt;/del&gt;you develop them from the user's point of view.  (Such a &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;point of view &lt;/del&gt;is one of the strengths of test-first &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;development&lt;/del&gt;.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;A good way &lt;/ins&gt;to design interfaces that are easy to use correctly is to ''exercise them before they exist''.  &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Mock &lt;/ins&gt;up a GUI -- possibly on a whiteboard or using index cards on a table -- and play with it before any of the underlying code has been created.  Write calls to an API before any of the functions have been declared.  Walk through various common use cases and specify how you ''want'' the interface to behave.  What do you ''want'' to be able to click on?  What do you ''want'' to be able to pass?  Easy to use interfaces seem natural, because they let you &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/ins&gt;do what you want to do.  You're more likely to come up with such interfaces if you develop them from the user's point of view.  (Such a &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;perspective &lt;/ins&gt;is one of the strengths of test-first &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;programming&lt;/ins&gt;.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making interfaces &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;that are &lt;/del&gt;hard to use incorrectly requires two things.  First, you must ''anticipate errors that users might inadvertently make,'' and you must find ways &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;for the interface &lt;/del&gt;to prevent such errors.  Second, you must ''observe how the interface is misused'' during early &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;usage&lt;/del&gt;, and you must be willing to modify the interface -- yes, modify the interface! -- to prevent such errors before &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;you deploy &lt;/del&gt;the interface further.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making interfaces hard to use incorrectly requires two things.  First, you must ''anticipate errors that users might inadvertently make,'' and you must find ways to prevent such errors.  Second, you must ''observe how the interface is misused'' during early &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;release&lt;/ins&gt;, and you must be willing to modify the interface -- yes, modify the interface! -- to prevent such errors before &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;deploying &lt;/ins&gt;the interface further.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>ScottMeyers</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=12964&amp;oldid=prev</id>
		<title>ScottMeyers at 23:43, 10 November 2008</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=12964&amp;oldid=prev"/>
				<updated>2008-11-10T23:43:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 23:43, 10 November 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''They're hard to use incorrectly.'''  Good interfaces are designed to anticipate the kinds of mistakes people might make and to make them difficult -- ideally impossible -- to commit.  A GUI might disable or remove commands that make no sense in the current context, for example, and an API might allow parameters to be passed in any order to eliminate &amp;quot;parameters passed out of order&amp;quot; problems.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''They're hard to use incorrectly.'''  Good interfaces are designed to anticipate the kinds of mistakes people might make and to make them difficult -- ideally impossible -- to commit.  A GUI might disable or remove commands that make no sense in the current context, for example, and an API might allow parameters to be passed in any order to eliminate &amp;quot;parameters passed out of order&amp;quot; problems.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;One of the best ways to design interfaces that are easy to use correctly is to exercise them before they exist.  That is, mock up a GUI -- possibly on a whiteboard or using index cards on a table -- and play with it before any of the underlying code has been created.  Write calls to an API before any of the functions have been declared.  Walk through various common use cases and specify how you ''want'' the interface to behave.  What do you ''want'' to be able to click on?  What do you ''want'' to be able to pass?  Easy to use interfaces seem natural, because they let you -- they ''encourage'' you -- to do what you want to do.  You're more likely to come up with such interfaces if, from the get-go, you develop them from the user's point of view.  (Such a point of view is one of the strengths of test-first development.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;One of the best ways to design interfaces that are easy to use correctly is to &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''&lt;/ins&gt;exercise them before they exist&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''&lt;/ins&gt;.  That is, mock up a GUI -- possibly on a whiteboard or using index cards on a table -- and play with it before any of the underlying code has been created.  Write calls to an API before any of the functions have been declared.  Walk through various common use cases and specify how you ''want'' the interface to behave.  What do you ''want'' to be able to click on?  What do you ''want'' to be able to pass?  Easy to use interfaces seem natural, because they let you -- they ''encourage'' you -- to do what you want to do.  You're more likely to come up with such interfaces if, from the get-go, you develop them from the user's point of view.  (Such a point of view is one of the strengths of test-first development.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making interfaces that are hard to use incorrectly requires two things.  First, you must anticipate errors that users might inadvertently make, and you must find ways for the interface to prevent such errors.  Second, you must observe how the interface is misused during early usage, and you must be willing to modify the interface -- yes, modify the interface! -- to prevent such errors before you deploy the interface further.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making interfaces that are hard to use incorrectly requires two things.  First, you must &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''&lt;/ins&gt;anticipate errors that users might inadvertently make,&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;'' &lt;/ins&gt;and you must find ways for the interface to prevent such errors.  Second, you must &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''&lt;/ins&gt;observe how the interface is misused&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;'' &lt;/ins&gt;during early usage, and you must be willing to modify the interface -- yes, modify the interface! -- to prevent such errors before you deploy the interface further.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>ScottMeyers</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=12963&amp;oldid=prev</id>
		<title>ScottMeyers at 23:42, 10 November 2008</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=Make_Interfaces_Easy_to_Use_Correctly_and_Hard_to_Use_Incorrectly&amp;diff=12963&amp;oldid=prev"/>
				<updated>2008-11-10T23:42:33Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 23:42, 10 November 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 8:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 8:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;One of the best ways to design interfaces that are easy to use correctly is to exercise them before they exist.  That is, mock up a GUI -- possibly on a whiteboard or using index cards on a table -- and play with it before any of the underlying code has been created.  Write calls to an API before any of the functions have been declared.  Walk through various common use cases and specify how you ''want'' the interface to behave.  What do you ''want'' to be able to click on?  What do you ''want'' to be able to pass?  Easy to use interfaces seem natural, because they let you -- they ''encourage'' you -- to do what you want to do.  You're more likely to come up with such interfaces if, from the get-go, you develop them from the user's point of view.  (Such a point of view is one of the strengths of test-first development.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;One of the best ways to design interfaces that are easy to use correctly is to exercise them before they exist.  That is, mock up a GUI -- possibly on a whiteboard or using index cards on a table -- and play with it before any of the underlying code has been created.  Write calls to an API before any of the functions have been declared.  Walk through various common use cases and specify how you ''want'' the interface to behave.  What do you ''want'' to be able to click on?  What do you ''want'' to be able to pass?  Easy to use interfaces seem natural, because they let you -- they ''encourage'' you -- to do what you want to do.  You're more likely to come up with such interfaces if, from the get-go, you develop them from the user's point of view.  (Such a point of view is one of the strengths of test-first development.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making interfaces that are hard to use incorrectly requires two things.  First, you must anticipate errors that users might inadvertently make, and you must find ways for the interface to prevent such errors.  Second, you must observe how the interface is misused during early usage, and you must be willing to modify the interface -- yes, modify the interface! -- to prevent such errors before you deploy the interface further.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>ScottMeyers</name></author>	</entry>

	</feed>