<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>silk and spinach</title>
	<atom:link href="http://silkandspinach.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://silkandspinach.net</link>
	<description>development, by example</description>
	<lastBuildDate>Wed, 08 Feb 2012 19:09:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='silkandspinach.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>silk and spinach</title>
		<link>http://silkandspinach.net</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://silkandspinach.net/osd.xml" title="silk and spinach" />
	<atom:link rel='hub' href='http://silkandspinach.net/?pushpress=hub'/>
		<item>
		<title>The wrong duplication (reprise)</title>
		<link>http://silkandspinach.net/2011/12/23/the-wrong-duplication-reprise/</link>
		<comments>http://silkandspinach.net/2011/12/23/the-wrong-duplication-reprise/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 14:56:23 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://silkandspinach.wordpress.com/?p=1337</guid>
		<description><![CDATA[I came across this old post again today, and I still like what it has to say: The Wrong Duplication. Maybe I should add a code example&#8230;?<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1337&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I came across this old post again today, and I still like what it has to say: <a href="http://silkandspinach.net/2006/11/05/the-wrong-duplication/">The Wrong Duplication</a>. Maybe I should add a code example&#8230;?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/silkandspinach.wordpress.com/1337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/silkandspinach.wordpress.com/1337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/silkandspinach.wordpress.com/1337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/silkandspinach.wordpress.com/1337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1337/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1337&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2011/12/23/the-wrong-duplication-reprise/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	</item>
		<item>
		<title>Global Day of Coderetreat</title>
		<link>http://silkandspinach.net/2011/11/16/global-day-of-coderetreat/</link>
		<comments>http://silkandspinach.net/2011/11/16/global-day-of-coderetreat/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 16:43:45 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=1335</guid>
		<description><![CDATA[In case you hadn&#8217;t noticed, XP-Manchester is running a Coderetreat as part of the Global Day of Coderetreat on December 3rd 2011. You can find out everything you need to know by visiting our page on Eventbrite, where you can find FAQs, links to further information, and the all-important sign-me-up button. Oh, and it&#8217;s FREE [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1335&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In case you hadn&#8217;t noticed, XP-Manchester is running a <a href="http://coderetreat.com/">Coderetreat</a> as part of the <a href="http://coderetreat.com/global_day.html">Global Day of Coderetreat on December 3rd 2011</a>.</p>
<p>You can find out everything you need to know by visiting <a href="http://coderetreatmanchester.eventbrite.co.uk/">our page on Eventbrite</a>, where you can find FAQs, links to further information, and the all-important sign-me-up button. Oh, and it&#8217;s FREE to attend.</p>
<p>Places are limited, and tickets are going fast now, so make sure you book your place soon!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/silkandspinach.wordpress.com/1335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/silkandspinach.wordpress.com/1335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/silkandspinach.wordpress.com/1335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/silkandspinach.wordpress.com/1335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1335/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1335&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2011/11/16/global-day-of-coderetreat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu, mysql and rails</title>
		<link>http://silkandspinach.net/2011/11/10/ubuntu-mysql-and-rails/</link>
		<comments>http://silkandspinach.net/2011/11/10/ubuntu-mysql-and-rails/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 16:16:06 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=1326</guid>
		<description><![CDATA[I just upgraded my work laptop to Ubuntu Natty Narwhal, and then I found all my rails projects broken. Whenever I tried to run up a rails server, I got this: $ rails server =&#62; Booting WEBrick =&#62; Rails 3.0.3 application starting in development on http://0.0.0.0:3000 =&#62; Call with -d to detach Exiting /path/to/gems/activerecord-3.0.3/lib/active_record/connection_adapters/mysql_adapter.rb:30: in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1326&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I just upgraded my work laptop to Ubuntu Natty Narwhal, and then I found all my rails projects broken. Whenever I tried to run up a rails server, I got this:</p>
<pre>$ rails server
=&gt; Booting WEBrick
=&gt; Rails 3.0.3 application starting in development on http://0.0.0.0:3000
=&gt; Call with -d to detach

Exiting
/path/to/gems/activerecord-3.0.3/lib/active_record/connection_adapters/mysql_adapter.rb:30:
in `mysql_connection': undefined method `init' for Mysql:Class (NoMethodError)</pre>
<p>(followed by a huge stacktrace). Googling didn&#8217;t help much, because every time anyone has asked about this on a forum, all of the answers are specific to Macs.</p>
<p>It turns out that the problem is that the mysql gem includes native code, which is built when you install the gem. And my existing mysql gem had been built against mysql libraries that are now, since my upgrade, out of date. So the fix turns out to be maddeningly simple. First, get rid of the gem that doesn&#8217;t work:</p>
<pre>$ gem uninstall mysql</pre>
<p>Next, get hold of the developer API libraries for mysql:</p>
<pre>$ sudo apt-get install libmysqlclient16-dev</pre>
<p>And finally, download and rebuild the gem again:</p>
<pre>$ gem install mysql</pre>
<p>Simples. I just hope this quick note saves you the hours of trawling through forums that I had to endure this morning.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/silkandspinach.wordpress.com/1326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/silkandspinach.wordpress.com/1326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/silkandspinach.wordpress.com/1326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/silkandspinach.wordpress.com/1326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1326/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1326&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2011/11/10/ubuntu-mysql-and-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	</item>
		<item>
		<title>Simple Design with Design Patterns</title>
		<link>http://silkandspinach.net/2011/10/28/1315/</link>
		<comments>http://silkandspinach.net/2011/10/28/1315/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 08:01:42 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[pattern]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=1315</guid>
		<description><![CDATA[In the blog post Simple Design with Design Patterns, Cory Foy runs a thought experiment in which he explores the use of patterns in solving the Game of Life kata. Cory&#8217;s starting point is the intention behind the GoF patterns, coupled with the XP rules of Simple Design and Uncle Bob&#8217;s SOLID principles. Cory stops his analysis [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1315&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In the blog post <a href="http://blog.coryfoy.com/2011/10/simple-design-with-design-patterns/">Simple Design with Design Patterns</a>, Cory Foy runs a thought experiment in which he explores the use of patterns in solving the <a href="http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life">Game of Life</a> kata. Cory&#8217;s starting point is the <em>intention</em> behind the <a href="http://en.wikipedia.org/wiki/Design_Patterns">GoF</a> patterns, coupled with the XP rules of <a href="http://c2.com/cgi/wiki?XpSimplicityRules">Simple Design</a> and Uncle Bob&#8217;s <a href="http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod">SOLID</a> principles.</p>
<p>Cory stops his analysis when he has the following model:</p>
<pre>|Cell| &lt;------- |Status|
           |Alive|    |Dead|</pre>
<p>At this point Cory says</p>
<blockquote><p>&#8220;Certainly if we implemented a Cell with a Status object with an AliveStatus class and a DeadStatus class someone, somewhere, should slap us upside the head.&#8221;</p></blockquote>
<p>However, I&#8217;d like to carry on from that point just a little further&#8230;</p>
<p>I like to teach the use of CRC for exploring design, and so I naturally looked at Cory&#8217;s objects from the point of view of their behaviours and responsibilities. Thus it struck me that if we <em>don&#8217;t</em> make the split suggested by Cory, we&#8217;d have a Cell that knows about its position/neighbours <strong>and</strong> knows what change to make when the clock ticks. That would violate the Single Responsibility Principle. So the above split into Cell and Status makes sense from the point of view of responsibilities, if we give the Status object the job of deciding how the Cell should change.</p>
<p>With those responsibilities in mind, a little mental CRC session suggests that, when the clock ticks, the Cell would tell its Status object how many neighbours it had, and ask for a new Status object in return.</p>
<p><pre class="brush: ruby;">
class Cell
  def change
    @status = @status.update_based_on(@number_of_neighbours)
  end
end</pre></p>
<p>The Status objects become Strategy/Policy objects, and thus don&#8217;t seem to need any instance state. All of which means that the Status objects could be <a href="http://c2.com/cgi/wiki?FlyweightPattern">Flyweights</a>, with only one extant instance of each type, referenced by every Cell that happens to be in the corresponding state.</p>
<p>I think this approach could well be worth a punt during the upcoming <a href="http://coderetreat.ning.com/events/event/listByDate?date=2011-12-03">Global Day of Coderetreats</a>&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/silkandspinach.wordpress.com/1315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/silkandspinach.wordpress.com/1315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/silkandspinach.wordpress.com/1315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/silkandspinach.wordpress.com/1315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1315/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1315&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2011/10/28/1315/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	</item>
		<item>
		<title>Don&#8217;t inherit code</title>
		<link>http://silkandspinach.net/2011/09/28/dont-inherit-code/</link>
		<comments>http://silkandspinach.net/2011/09/28/dont-inherit-code/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 07:01:16 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=1309</guid>
		<description><![CDATA[I learned a long time ago that there are essentially three different kinds of relationship between two classes. They are, in order of increasing tightness: Uses, in which I care only about your public API; Creates, in which I also need to know your class; Inherits/extends, in which I can also see some of your [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1309&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I learned a long time ago that there are essentially three different kinds of relationship between two classes. They are, in order of increasing tightness:</p>
<ol>
<li><strong>Uses</strong>, in which I care only about your public API;</li>
<li><strong>Creates</strong>, in which I also need to know your class;</li>
<li><strong>Inherits/extends</strong>, in which I can also see some of your workings and I become part of you.</li>
</ol>
<p>Don&#8217;t do that last one. Ever.</p>
<p>Many of the GoF patterns help move code up this list, from tight towards loose coupling. Except <strong>TemplateMethod</strong>, which not only encourages inheritance, it also creates a circular dependency by having the superclass only &#8220;work&#8221; in the presence of extensions. Bad.</p>
<p>Don&#8217;t inherit code. Bad.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/silkandspinach.wordpress.com/1309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/silkandspinach.wordpress.com/1309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/silkandspinach.wordpress.com/1309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/silkandspinach.wordpress.com/1309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1309/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1309&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2011/09/28/dont-inherit-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	</item>
		<item>
		<title>Conditionals on the edge</title>
		<link>http://silkandspinach.net/2011/09/19/conditionals-on-the-edge/</link>
		<comments>http://silkandspinach.net/2011/09/19/conditionals-on-the-edge/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 20:33:03 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[architecture]]></category>
		<category><![CDATA[duplication]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=1283</guid>
		<description><![CDATA[As you know, I have a thing about conditional code. Most conditionals are duplicates, and the only &#8220;genuine&#8221; conditionals are at the system boundaries, where they test external state and input information. But I discovered recently that, even at the edges, not every conditional is necessary&#8230; Here&#8217;s (a drastically simplified version of) some code I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1283&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As you know, I have a thing about <a title="the anti-if campaign" href="http://silkandspinach.net/2008/10/23/the-anti-if-campaign/">conditional code</a>. <a title="if…" href="http://silkandspinach.net/2004/07/16/if/">Most conditionals are duplicates</a>, and the only &#8220;genuine&#8221; conditionals are at the <a title="hexagonal soup" href="http://silkandspinach.net/2004/07/16/hexagonal-soup/">system boundaries</a>, where they test external state and input information. But I discovered recently that, even at the edges, not every conditional is necessary&#8230;</p>
<p>Here&#8217;s (a drastically simplified version of) some code I wrote a while back. (It&#8217;s from a Rails app, but the message in this post applies to any technology and any kind of system input.)</p>
<p><pre class="brush: ruby;">
class Users::RegistrationsController &lt; Devise::RegistrationsController
  def create
    user = create_new_user_account
    if params[:invitation_token]
      sign_in_as(user)
      redirect_to Invitation.find(params[:invitation_token]).shared_content
    else
      redirect_to new_user_session_path
    end
  end
end</pre></p>
<p>This route handles incoming user registrations, and it has a conditional branch to cater for the case in which the new user was invited, via email, by an existing user. If the new user arrived by clicking a link in an email we do one set of things; whereas we do a different set of things if the user got here via the <em>&#8216;Register now&#8217;</em> button on the home page. Perfectly reasonable, I thought. Sure, it&#8217;s conditional code; but it&#8217;s sitting on the system boundary and therefore it&#8217;s fine, yes? No.</p>
<p><strong>This conditional check represents duplication</strong>. Somewhere else in my application already knew, at some time in the recent past, which route should be taken through this method when it was finally invoked. When the app sent that email invitation, it was in a sense delegating to the recipient the task of supplying user account details. The conditional branch that handles the invitation is a callback from across a technology boundary, and the inviting code already knew to expect it.</p>
<p>The duplication also has a nasty side-effect: high complexity. This method is an order of magnitude harder to understand and to test(-drive) because of the conditional construct. (And you&#8217;re reading a version from which I&#8217;ve elided all manner of error handling.) Oh, and by forcing two routes into the same method I also made it violate the Single Responsibility Principle.</p>
<p>Happily the duplication is really easy to remove. The code that sends the email invitation knows which path it wants the registration code to take, so I just need to create a new input route for &#8220;invitation acceptance&#8221; and change the email invitation to link to it. As a result I&#8217;ll have two controller methods, each with simpler logic than their predecessor:</p>
<p><pre class="brush: ruby;">
class Users::RegistrationsController &lt; Devise::RegistrationsController
  def create
    user = create_new_user_account
    redirect_to new_user_session_path
  end
end</pre><br />
<pre class="brush: ruby;">
class InvitationAcceptancesController &lt; Devise::RegistrationsController
  def create
    user = create_new_user_account
    sign_in_as(user)
    redirect_to Invitation.find(params[:invitation_token]).shared_content
    end
  end
end
</pre></p>
<p>So I have now removed the duplication, and the controller code is simpler as a result. These controller methods are also much easier to test(-drive) than the earlier code. And as a final bonus, I can design the user interface to this route with more knowledge, maybe adding some details of the invitation so that the incoming potential user feels a little more at home. In short, now that each code path has its own method (and class) I can pay it more attention, and it will flourish as a result.</p>
<p>Now, having refactored this code, I take away a few points for the future:</p>
<ul>
<li>Where appropriate and possible, model system outputs as delegations into a space that your code can&#8217;t reach or control; and model the resulting future input as a response.</li>
<li>Where a system input is due to the system having earlier delegated a responsibility across its boundary, make sure the return route is differentiated from all others.</li>
<li>Differentiated incoming routes have code that is easier to read and simpler to test.</li>
<li>When an input route has a single use, the user experience can be tailored and enriched.</li>
<li>Not every conditional at the system boundary tests external state.</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/silkandspinach.wordpress.com/1283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/silkandspinach.wordpress.com/1283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/silkandspinach.wordpress.com/1283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/silkandspinach.wordpress.com/1283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1283/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1283&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2011/09/19/conditionals-on-the-edge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	</item>
		<item>
		<title>Why I don&#8217;t use spork</title>
		<link>http://silkandspinach.net/2011/08/08/why-i-dont-use-spork/</link>
		<comments>http://silkandspinach.net/2011/08/08/why-i-dont-use-spork/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 20:31:02 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=1280</guid>
		<description><![CDATA[Spork is great. And so is guard and its family of plugins. Early this year I spent a while converting all of my rails projects to use spork, and we even had a team standard tmux setup that ran spork in one of the start-up screens. So every time we saved a file, guard/spork ran [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1280&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="https://rubygems.org/gems/spork">Spork</a> is great. And so is <a href="https://rubygems.org/gems/guard">guard</a> and its family of plugins. Early this year I spent a while converting all of my rails projects to use spork, and we even had a team standard tmux setup that ran spork in one of the start-up screens. So every time we saved a file, guard/spork ran some of our specs. We even had growl/notify pop up a little message telling us the result, so we didn&#8217;t have to go to the trouble of switching screen to find out. How very efficient!</p>
<p>But now I&#8217;ve turned spork off, and here&#8217;s why: <strong>Spork solves the wrong problem.</strong></p>
<p>We enabled guard/spork because our specs were slow, and during the few months we had spork, those specs became even slower. <em>But we never noticed. </em>Most of the time guard/spork guessed correctly which specs to run, and we became quite good at configuring guard to re-load Rails when critical files changed. So we were reasonably comfortable, and our specs ran quickly most of the time. <em>But our design was getting worse every day.</em></p>
<p><em></em>Slow specs are a sign of too much coupling, and in the case of a Rails app that usually means not enough separation between the <a href="http://silkandspinach.net/2005/03/22/the-middle-hexagon-should-be-independent-of-the-adapters/">domain objects and the adapters</a>. So we&#8217;ve stopped running spork, so that we can feel the pain of the 15-second Rails load time, and so that we can feel the pain of all that coupling. And slowly we are making the app&#8217;s specs faster. Many spec files now run in under a hundredth of a second, and more will follow as we gradually peel domain code out from the Rails infrastructure. We don&#8217;t need to test the Rails components, and we have a very good suite of cucumber features that act as end-to-end integration tests. So our specs should be fast, and only need to tell us that our own objects each do their thing. That&#8217;s what we are now working towards, and that&#8217;s the pot of gold that spork was hiding from us.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/silkandspinach.wordpress.com/1280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/silkandspinach.wordpress.com/1280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/silkandspinach.wordpress.com/1280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/silkandspinach.wordpress.com/1280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1280/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1280&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2011/08/08/why-i-dont-use-spork/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	</item>
		<item>
		<title>Faster Rails controller specs</title>
		<link>http://silkandspinach.net/2011/08/07/faster-rails-controller-specs/</link>
		<comments>http://silkandspinach.net/2011/08/07/faster-rails-controller-specs/#comments</comments>
		<pubDate>Sun, 07 Aug 2011 20:03:30 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=1258</guid>
		<description><![CDATA[One of the Rails apps I work on has this: $ rspec spec #... Finished in 61.82 seconds 475 examples, 0 failures 61 seconds!  (And on top of that I have to wait another 15 seconds for Rails load; that&#8217;s a whole other story, and I hope to come back to that in a future [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1258&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of the Rails apps I work on has this:</p>
<pre>$ rspec spec
#...
Finished in 61.82 seconds
475 examples, 0 failures</pre>
<p>61 seconds!  (And on top of that I have to wait another 15 seconds for Rails load; that&#8217;s a whole other story, and I hope to come back to that in a future post.) A quick dig into the 61 seconds reveals this:</p>
<pre>$ rspec spec/controllers
#...
Finished in 22.82 seconds
114 examples, 0 failures</pre>
<p>It happens that almost every controller action in our app needs the user to be logged in, so every controller spec needs that too. We&#8217;re using <a href="https://rubygems.org/gems/devise">Devise</a>, so every spec has something equivalent to this:</p>
<pre>before :each do
  sign_in Factory(:user)
end</pre>
<p>This implies hits on the database to create the user object, record the IP address and last sign-in time, etc etc. We can do much better by using a <code>mock_model</code> for the User, and stubbing out <a href="https://rubygems.org/gems/warden">Warden</a>&#8216;s authentication completely.</p>
<p>First, in the interests of DRYness, I made some helper methods to do some of the jobs that <a href="https://rubygems.org/gems/factory_girl">factory_girl</a> does:</p>
<pre>module RandomHelpers
  def random_number() SecureRandom.random_number(10000); end
  def random_id() random_number; end
  def random_name() SecureRandom.hex(20); end
end</pre>
<p>Next, a method that creates a <a href="http://martinfowler.com/articles/mocksArentStubs.html">test double</a> representing the User who will be logged in:</p>
<pre>module ControllerHelpers
  def user_double(attrs = {})
    user_attrs = {
      :first_name =&gt; random_name,
      :last_name =&gt; random_name,
      :authenticatable_salt =&gt; 'x'
    }.merge(attrs)
    mock_model(User, user_attrs)
  end
end</pre>
<p>This is the place to fill the User double with default attribute values. Our app requires every User to have a first and last name, so I&#8217;ve stubbed these with random strings; they can be overridden by the caller if specific values are needed for any test. In your own app, change this method to set any mandatory attributes your user model needs. Note also the stubbed <code>authenticatable_salt()</code> method, which wasn&#8217;t required when mocking earlier versions of Devise.</p>
<p>I also need a method that logs a user in:</p>
<pre>module ControllerHelpers
  def stub_sign_in_with(user)
    request.env['warden'] = double(Warden,
                                   :authenticate =&gt; user,
                                   :authenticate! =&gt; user,
                                   :authenticate? =&gt; true)
    sign_in(user)
    return user
  end
end</pre>
<p>This replaces Warden with a test double, and Devise is none the wiser.<br />
I also create a method to glue these together for the simplest (and most common) case:</p>
<pre>module ControllerHelpers
  def stub_sign_in(attrs = {})
    stub_sign_in_with user_double(attrs)
  end
end</pre>
<p>(Note that this returns the User double; you&#8217;ll see why that&#8217;s useful in a moment.)</p>
<p>Finally, I configure the specs so they have access to these helper methods. To achieve that, <code>spec/spec_helper.rb</code> needs to look something like this:</p>
<pre>Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}

RSpec.configure do |config|
  config.include RandomHelpers
  config.include Devise::TestHelpers, :type =&gt; :controller
  config.include ControllerHelpers, :type =&gt; :controller
end</pre>
<p>Putting all this together allows me to write controller specs with:</p>
<pre>before do
  stub_sign_in
end</pre>
<p>or, if I need access to the user double:</p>
<pre>let(:user) { stub_sign_in }</pre>
<p>And the payoff?</p>
<pre>$ rspec spec/controllers
#...
Finished in 7.36 seconds
114 examples, 0 failures</pre>
<p>I saved as whole 15 seconds! There&#8217;s still some work to do in my specs, but stubbing out Warden has made a massive difference to every test run that involves this project&#8217;s controller microtests.</p>
<p>Note that the above has been tested only with the following gem versions:</p>
<ul>
<li>rails 3.0.3</li>
<li>devise 1.3.4</li>
<li>warden 1.0.4</li>
<li>rspec-core 2.6.4</li>
<li>rspec-mocks 2.6.0</li>
<li>rspec-rails 2.6.1</li>
<li>factory_girl 1.3.3</li>
</ul>
<p>A condensed gist for the above code is <a href="https://gist.github.com/1130290">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/silkandspinach.wordpress.com/1258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/silkandspinach.wordpress.com/1258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/silkandspinach.wordpress.com/1258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/silkandspinach.wordpress.com/1258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1258/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1258&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2011/08/07/faster-rails-controller-specs/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	</item>
		<item>
		<title>When software smells bad</title>
		<link>http://silkandspinach.net/2011/07/29/when-software-smells-bad/</link>
		<comments>http://silkandspinach.net/2011/07/29/when-software-smells-bad/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 12:14:06 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://silkandspinach.wordpress.com/2011/07/29/when-software-smells-bad/</guid>
		<description><![CDATA[It turns out I co-wrote the feature article in this month&#8217;s Better Software magazine!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1256&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class='posterous_autopost'>
<p>It turns out I co-wrote the <a href="http://www.stickyminds.com/BetterSoftware/magazine.asp?fn=cifea">feature article</a> in this month&#8217;s Better Software magazine!</p>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/silkandspinach.wordpress.com/1256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/silkandspinach.wordpress.com/1256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/silkandspinach.wordpress.com/1256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/silkandspinach.wordpress.com/1256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1256/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1256&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2011/07/29/when-software-smells-bad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	</item>
		<item>
		<title>Wabi-Sabi</title>
		<link>http://silkandspinach.net/2011/07/10/wabi-sabi/</link>
		<comments>http://silkandspinach.net/2011/07/10/wabi-sabi/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 13:14:41 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I just posted this review of Wabi-Sabi: For Artists, Designers, Poets and Philosophers by Leonard Koren: This is a wonderful little book about the Japanese art style called Wabi-sabi. The book is short, and many of the pages consist solely of full-page photographs illustrating the ideas. So it&#8217;s a quick read, but worth taking the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1254&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class='posterous_autopost'>
<p>I just posted this review of <a href="http://amzn.to/mS94TV">Wabi-Sabi: For Artists, Designers, Poets and Philosophers</a> by Leonard Koren:</p>
<p>This is a wonderful little book about the Japanese art style called Wabi-sabi. The book is short, and many of the pages consist solely of full-page photographs illustrating the ideas. So it&#8217;s a quick read, but worth taking the time to read slowly, let it sink in, and then read again.</p>
<p>Wabi sabi itself originated as an eclectic style of the Japanese tea ceremony, emphasising the impermanence and ever-changing quality of all things. But the book keeps its feet on the ground and doesn&#8217;t spend too much time deep in Zen territory.</p>
<p>I read this book on Kent Beck&#8217;s recommendation during the early years of eXtreme Programming &#8212; see <a href="http://c2.com/cgi/wiki?WabiSabi">http://c2.com/cgi/wiki?WabiSabi</a> for more on that. As an XP/agile coach I recommend it to any team that gets hung up on the search for perfection, to remind them that every state is transitional, and the idea of anything being &#8220;finished&#8221; is an illusion.</p>
<p>&nbsp;</p>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/silkandspinach.wordpress.com/1254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/silkandspinach.wordpress.com/1254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/silkandspinach.wordpress.com/1254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/silkandspinach.wordpress.com/1254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1254/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1254&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2011/07/10/wabi-sabi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	</item>
		<item>
		<title>Hexagonal architecture: reprise</title>
		<link>http://silkandspinach.net/2011/06/28/hexagonal-architecture-reprise/</link>
		<comments>http://silkandspinach.net/2011/06/28/hexagonal-architecture-reprise/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 19:22:44 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[While browsing around other folks&#8217; blogs today I came across a link to a post I wrote back in March 2005. Six years on I think it still stands up, and so I commend it to you, dear reader: The Middle Hexagon Should be Independent of the Adapters.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1252&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class='posterous_autopost'>
<p>While browsing around other folks&#8217; blogs today I came across a link to a post I wrote back in March 2005. Six years on I think it still stands up, and so I commend it to you, dear reader: <a href="http://silkandspinach.net/2005/03/22/the-middle-hexagon-should-be-independent-of-the-adapters/">The Middle Hexagon Should be Independent of the Adapters</a>.</p>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/silkandspinach.wordpress.com/1252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/silkandspinach.wordpress.com/1252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/silkandspinach.wordpress.com/1252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/silkandspinach.wordpress.com/1252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1252/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1252&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2011/06/28/hexagonal-architecture-reprise/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	</item>
		<item>
		<title>RIP Eliyahu M. Goldratt</title>
		<link>http://silkandspinach.net/2011/06/12/rip-eliyahu-m-goldratt/</link>
		<comments>http://silkandspinach.net/2011/06/12/rip-eliyahu-m-goldratt/#comments</comments>
		<pubDate>Sun, 12 Jun 2011 13:32:19 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://silkandspinach.wordpress.com/2011/06/12/rip-eliyahu-m-goldratt/</guid>
		<description><![CDATA[&#8220;I smile and start to count on my fingers: One, people are good. Two, every conflict can be removed. Three, every situation, no matter how complex it initially looks, is exceedingly simple. Four, every situation can be substantially improved; even the sky is not the limit. Five, every person can reach a full life. Six, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1248&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="posterous_autopost">
<blockquote style="border-collapse:collapse;font-family:arial, sans-serif;"><p><em>&#8220;I smile and start to count on my fingers: One, people are good. Two, every conflict can be removed. Three, every situation, no matter how complex it initially looks, is exceedingly simple. Four, every situation can be substantially improved; even the sky is not the limit. Five, every person can reach a full life. Six, there is always a win-win solution. Shall I continue to count?&#8221;</em></p></blockquote>
<p style="border-collapse:collapse;font-family:arial, sans-serif;font-size:18px;text-align:left;">&#8211; Dr. Eliyahu M. Goldratt, 1947- 2011</p>
<p style="border-collapse:collapse;font-size:18px;text-align:left;"><span style="font-size:small;">Eli Goldratt wrote many books, and among them these four stand out as having changed my work (and life, I guess) for the better:</span></p>
<ul>
<li><span style="font-size:small;"><span style="border-collapse:collapse;"><a href="http://amzn.to/fadyAP">The Goal</a> &#8212; a novel, about a chap who has three months to save a failing factory. This is where it all began, and the ideas apply to so many different situations in so many different fields. I&#8217;d include this in my top 5 books of all time.</span></span></li>
<li><span style="font-size:small;"><span style="border-collapse:collapse;"><a href="http://amzn.to/kFg8wn">It&#8217;s Not Luck</a> &#8212; another novel, and the sequel to <em>The Goal</em>. Provides a basic introduction to the Thinking Tools by showing how to use them in analysing a variety of business problems.</span></span></li>
<li><span style="font-size:small;"><span style="border-collapse:collapse;"><a href="http://amzn.to/fr3Fpm">The Choice</a> &#8212; a manifesto, quoted above. In this book Goldratt takes to the soap-box and presents his manifesto for happiness through logic and clear thinking. I disagree with his logic at one major turning point, but overall the message is good, strong and empowering.</span></span></li>
<li><span style="font-size:small;"><span style="border-collapse:collapse;"><a href="http://amzn.to/kqJ3n6">The Race</a> &#8212; a workbook for learning about flow using the Theory of Constraints. This book is not for the faint-hearted, though thankfully it has no differential equations. Even though I had read and understood <em>The Goal</em>, and applied the ideas in many organisations, <em>The Race</em> taught me some deep new surprises.</span></span></li>
</ul>
<p>I read each of those books again every couple of years, and each time my insights deepen. Goldratt was a true genius, and I&#8217;m surprised at how much his death has affected me this weekend.</p>
<p>Long live <em>The Goal</em>.</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/silkandspinach.wordpress.com/1248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/silkandspinach.wordpress.com/1248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/silkandspinach.wordpress.com/1248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/silkandspinach.wordpress.com/1248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1248/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1248&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2011/06/12/rip-eliyahu-m-goldratt/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	</item>
		<item>
		<title>Code must be workable</title>
		<link>http://silkandspinach.net/2011/06/08/code-must-be-workable/</link>
		<comments>http://silkandspinach.net/2011/06/08/code-must-be-workable/#comments</comments>
		<pubDate>Wed, 08 Jun 2011 18:42:28 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://silkandspinach.wordpress.com/2011/06/08/code-must-be-workable/</guid>
		<description><![CDATA[&#8220;&#160;I do not view a project as the sum of its code. Rather, it is the view of that code through the tooling that it is designed to take advantage of. By targeting my code towards my tools, I can get a lot of value with a lot less code.&#8220; &#8211; Arlo Belshee, setting up [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1246&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class='posterous_autopost'>
<blockquote>
<p>&#8220;<span style="color:#333333;font-family:verdana, tahoma, arial, sans-serif;font-size:12px;line-height:19px;">&nbsp;I do not view a project as the sum of its code. Rather, it is the view of that code through the tooling that it is designed to take advantage of. By targeting my code towards my tools, I can get a lot of value with a lot less code.</span>&#8220;</p>
</blockquote>
<p>&#8211; Arlo Belshee, setting up the conditions for his <a href="http://arlobelshee.com/post/mock-free-example-part-1-project-intro">mock-free project</a></p>
<p>This is a nice extension of the idea that code should be &#8220;habitable&#8221;; that code exists not just to execute, but to be further worked by future developers. I&#8217;m very much looking forward to this series of articles from Arlo&#8230;</p>
<p>&nbsp;</p>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/silkandspinach.wordpress.com/1246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/silkandspinach.wordpress.com/1246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/silkandspinach.wordpress.com/1246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/silkandspinach.wordpress.com/1246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1246/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1246&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2011/06/08/code-must-be-workable/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	</item>
		<item>
		<title>contract tests in rspec</title>
		<link>http://silkandspinach.net/2011/05/23/contract-tests-in-rspec/</link>
		<comments>http://silkandspinach.net/2011/05/23/contract-tests-in-rspec/#comments</comments>
		<pubDate>Mon, 23 May 2011 15:59:14 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Here&#8217;s a quick experience report, about something I noticed myself doing this week&#8230; I&#8217;m developing a ruby app that&#8217;s something like a library. I have some code that collects the names of the user&#8217;s 5 last visited items, which could be books, DVDs, MP3 downloads etc. Right now we only need the items&#8217; names, so [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1241&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="posterous_autopost">
<p>Here&#8217;s a quick experience report, about something I noticed myself doing this week&#8230;</p>
<p>I&#8217;m developing a ruby app that&#8217;s something like a library. I have some code that collects the names of the user&#8217;s 5 last visited items, which could be books, DVDs, MP3 downloads etc. Right now we only need the items&#8217; names, so the collector calls the &lt;code&gt;name&lt;/code&gt; method on each object in the collection, and duck-typing does the rest, right?</p>
<p>Well, only if each class of &#8220;visitable&#8221; thing defines a &lt;code&gt;name&lt;/code&gt; method that has the right semantics for this collection. if this were a statically typed language such as Java we&#8217;d define a &lt;code&gt;Visitable&lt;/code&gt; interface and have classes Book, DVD, MP3 implement it. But this is Ruby, so we don&#8217;t do that. And yet, when I add another &#8220;visitable&#8221; class, I need to get those semantics right or else I&#8217;ll break that collection (or worse, something far away that uses it).</p>
<p>This is where J.B.Rainsberger&#8217;s idea of <a title="contract tests" href="http://blog.thecodewhisperer.com/post/1325859246/in-brief-contract-tests" target="_blank">contract tests</a> helps out. If I define a set of tests for the contract between the collection and the &#8220;visitables&#8221;, I&#8217;ll get some advance warning of likely trouble when I add more visitable classes.</p>
<p>In this case, all we need is for the &#8220;visitable&#8221; object to have a non-nil name. I write that contract as a shared example group:</p>
<pre>shared_examples_for 'a visitable item' do
  its(:name) { should_not be_nil }
end</pre>
<p>And then check that every &#8220;visitable&#8221; class implements it correctly:</p>
<pre>require 'spec_helper'

describe Book do
  it_should_behave_like 'a visitable item'

  # more specs ...
end</pre>
<p>And as if to prove the point, when I added this test to the specs for every &#8220;visitable&#8221; class, one of them failed. I had a broken collection waiting just around the corner, but the contract tests made sure no-one saw it before it was fixed.</p>
<p>In general, contract tests will be richer than this example. But I think the approach holds good: use a shared example group to &#8220;specify&#8221; the contract between a client and a polymorphic group of supplier classes.</p>
<p>Update:</p>
<p>Ashley Moran <a href="http://twitter.com/#!/wisemonkeyash/statuses/72712585996283904" target="_blank">suggests</a> aliasing the standard rspec methods to make it clearer that these are contract tests. And after a wee bit of discussion we settled on this:</p>
<pre>contract_for 'a visitable item' do
  its(:name) { should_not be_nil }
end</pre>
<p>and this:</p>
<pre>describe Book do
  it_satisfies_contract_for 'a visitable item'

  # more specs ...
end</pre>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/silkandspinach.wordpress.com/1241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/silkandspinach.wordpress.com/1241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/silkandspinach.wordpress.com/1241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/silkandspinach.wordpress.com/1241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1241/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1241&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2011/05/23/contract-tests-in-rspec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	</item>
		<item>
		<title>Vim points out Long Method</title>
		<link>http://silkandspinach.net/2011/05/01/vim-points-out-long-method/</link>
		<comments>http://silkandspinach.net/2011/05/01/vim-points-out-long-method/#comments</comments>
		<pubDate>Sun, 01 May 2011 19:00:32 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://silkandspinach.wordpress.com/2011/05/01/vim-points-out-long-method/</guid>
		<description><![CDATA[Here&#8217;s a nice observation from @mattwynne about vim, which is currently our editor of choice when remotely pairing: As we become sharper with vim&#8217;s text-navigation commands we find we&#8217;re using { and } to jump from &#8220;paragraph&#8221; to paragraph, and particularly to jump from method to method. So when a method has a blank line [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1239&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class='posterous_autopost'>
<p>Here&#8217;s a nice observation from <a href="http://twitter.com/#!/mattwynne">@mattwynne</a> about vim, which is currently our editor of choice when remotely pairing:</p>
<p>As we become sharper with vim&#8217;s text-navigation commands we find we&#8217;re using { and } to jump from &#8220;paragraph&#8221; to paragraph, and particularly to jump from method to method. So when a method has a blank line somewhere inside it, the } won&#8217;t jump over the entire method; it jumps to the line break instead.</p>
<p>That&#8217;s vim reminding us that this method violates the <a href="http://en.wikipedia.org/wiki/Single_responsibility_principle">SRP</a>.</p>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/silkandspinach.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/silkandspinach.wordpress.com/1239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/silkandspinach.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/silkandspinach.wordpress.com/1239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1239/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&amp;blog=1064186&amp;post=1239&amp;subd=silkandspinach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2011/05/01/vim-points-out-long-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	</item>
	</channel>
</rss>
