<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Tom Moertel's Weblog: Tag cost</title>
    <link>http://blog.moertel.com/articles/tag/cost?tag=cost</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Quality rants on programming theory and stuff geeks like</description>
    <item>
      <title>Cost-reducing interfaces should be the focus</title>
      <description>&lt;p&gt;I have been following with interest the debate about &amp;#8220;humane&amp;#8221; 
vs. &amp;#8220;minimal&amp;#8221; interfaces, sparked recently by &lt;a href="http://www.cafeaulait.org/oldnews/news2005December6.html"&gt;Elliotte Rusty Harold&amp;#8217;s
response&lt;/a&gt; to
&lt;a href="http://martinfowler.com/bliki/HumaneInterface.html"&gt;Martin Fowler&amp;#8217;s HumaneInterface
post&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Harold writes:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;Martin Fowler&amp;#8217;s a really smart guy, and he&amp;#8217;s pretty reliably
right; but today he manages to get it 180° wrong. &lt;span class="caps"&gt;A 78&lt;/span&gt; method List
class is about three times as bad as a 25 method List class, not three
times as good. &lt;span class="caps"&gt;A 12&lt;/span&gt; method List class would be about twice as
good. Simplicity is a virtue for both users and implementers. There&amp;#8217;s
simply no reason for 78 methods in a basic List class.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;The problem with Harold&amp;#8217;s argument is that he is using the
wrong goodness metric.  His metric is interface complexity when
it ought to be overall cost.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Cost is what counts.&lt;/strong&gt;  If adding methods (or making any change, for that matter) reduces the overall cost of
getting legitimate work done, it&amp;#8217;s the right thing to do.  That&amp;#8217;s
all there is to it.&lt;/p&gt;


	&lt;p&gt;Yes, adding methods to a library increases complexity and thus
increases the cost of understanding and using the library.
Adding methods to a library means asking users to make a small
investment of their time and mental capacity in exchange for the
promise of a later return &amp;#8211; clarity and code savings.  The duty of a
library designer, then, is to make sure that this return is
worthwhile, that the additions are useful enough and used frequently
enough to pay for themselves.&lt;/p&gt;


	&lt;p&gt;In &lt;a href="http://www.cafeaulait.org/oldnews/news2005December8.html"&gt;a later post&lt;/a&gt;,
Harold implicitly acknowledges the does-it-pay-for-itself test when he lists some methods from &lt;a href="http://www.ruby-doc.org/core/classes/Array.html"&gt;Ruby&amp;#8217;s Array class&lt;/a&gt; that he thinks are unjustified.  He writes:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;Do you really need any of [these methods] getting in your way?
Possibly you need one or two of these methods; but how often, and how
many?&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;The thing is, I use many of the methods he lists.  Further, the ones I
don&amp;#8217;t use don&amp;#8217;t seem to get in my way.  In sum, those methods have
paid me back far more than I have invested in them.  Given this, why &lt;em&gt;shouldn&amp;#8217;t&lt;/em&gt; they be in the Array class?&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m not saying that &amp;#8220;humane&amp;#8221; interfaces are better.  Rather, I&amp;#8217;m
saying that &lt;strong&gt;focusing on &amp;#8220;humane&amp;#8221; vs. &amp;#8220;minimal&amp;#8221; is missing the forest for
the trees.&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;Cost is what matters, so why shouldn&amp;#8217;t it be the focus?  Who cares if
that focus leads us to a &amp;#8220;humane&amp;#8221; interface one time and a &amp;#8220;minimal&amp;#8221; 
interface another?  With cost as our guide, we&amp;#8217;ll always arrive at a
good interface.&lt;/p&gt;</description>
      <pubDate>Thu, 08 Dec 2005 17:35:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:487847a070f866c536cf21a3e6103796</guid>
      <author>Tom Moertel</author>
      <link>http://blog.moertel.com/articles/2005/12/08/cost-reducing-interfaces-should-be-the-focus</link>
      <category>programming</category>
      <category>cost</category>
      <category>interfaces</category>
      <category>programming</category>
      <category>minimal</category>
      <category>humane</category>
      <trackback:ping>http://blog.moertel.com/articles/trackback/21</trackback:ping>
    </item>
  </channel>
</rss>
