<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Virtuous Code</title>
	
	<link>http://avdi.org/devblog</link>
	<description>"...the three great virtues of a programmer: laziness, impatience, and hubris." -- Larry Wall</description>
	<lastBuildDate>Thu, 04 Mar 2010 14:44:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/us/</creativeCommons:license>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/VirtuousCode" /><feedburner:info uri="virtuouscode" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>The New Openness</title>
		<link>http://feedproxy.google.com/~r/VirtuousCode/~3/3E3gQ38z25Y/</link>
		<comments>http://avdi.org/devblog/2010/03/04/the-new-openness/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 14:43:05 +0000</pubDate>
		<dc:creator>avdi</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iso]]></category>
		<category><![CDATA[standardization]]></category>

		<guid isPermaLink="false">http://avdi.org/devblog/?p=518</guid>
		<description><![CDATA[Herb Sutter wrote a post explaining the ISO meaning of the word &#8220;open&#8221;. I responded:

I understand that this was once a perfectly acceptable interpretation of the word &#8220;open&#8221;, but the software world has moved on. Groups like the  IETF, W3C, and WHATWG - not to mention the Open Source movement as a whole &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>Herb Sutter wrote <a href="http://herbsutter.wordpress.com/2010/03/03/where-can-you-get-the-iso-c-standard-and-what-does-open-standard-mean/">a post explaining the <span class="caps">ISO </span>meaning of the word &#8220;open&#8221;</a>. I <a href="http://herbsutter.wordpress.com/2010/03/03/where-can-you-get-the-iso-c-standard-and-what-does-open-standard-mean/#comment-1774">responded</a>:</p>

<p>I understand that this was <a href="http://en.wikipedia.org/wiki/The_Open_Group">once</a> a perfectly acceptable interpretation of the word &#8220;open&#8221;, but the software world has moved on. Groups like the  <span class="caps">IETF, W3C, </span>and <span class="caps">WHATWG </span>- not to mention the Open Source movement as a whole &#8211; have set a new bar for what it means to be &#8220;open&#8221; in computing. And by and large the standards emanating from those groups have been the better for being transparently and publicly debated, and made available for free. </p>

<p>Not to mention the positive effect the new openness has on standards adoption. I can <a href="http://support.github.com/discussions/site/1151-api-returns-403-when-rate-limiting">tell Github</a> that I think they are using the wrong <span class="caps">HTTP </span>response code in a web service, and they can google &#8220;<a href="http://www.google.com/search?q=http+response+codes">http response codes</a>&#8221; and check it for themselves in a matter of seconds. They would be less likely to do that if they had to purchase some <span class="caps">PDF </span>and search through it.</p>

<p>The <span class="caps">ISO </span>version of &#8220;openness&#8221; is one of the reasons the English-speaking Ruby community has largely taken the view that the effort to create an <span class="caps">ISO </span>standard around Ruby is irrelevant and not worth their attention. I recently created a <a href="http://ruby-standard.org">wiki</a> just so interested people could have a place to openly pick apart and discuss the draft Ruby standard. I shouldn&#8217;t have had to do that.</p>

<p>I&#8217;m in the camp that thinks standards are useful and worthwhile efforts. C++ in particular has benefited from a robust standardization process. The world has changed, though; for the better in my opinion. &#8220;Open&#8221; means more than it ever has before, and that&#8217;s a good thing. Standards organizations would do well to embrace the new openness, or risk decreasing relevance.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=3E3gQ38z25Y:Ym985GCKqsQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=3E3gQ38z25Y:Ym985GCKqsQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=3E3gQ38z25Y:Ym985GCKqsQ:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=3E3gQ38z25Y:Ym985GCKqsQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=3E3gQ38z25Y:Ym985GCKqsQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=3E3gQ38z25Y:Ym985GCKqsQ:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=3E3gQ38z25Y:Ym985GCKqsQ:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/VirtuousCode/~4/3E3gQ38z25Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://avdi.org/devblog/2010/03/04/the-new-openness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/us/</creativeCommons:license>
	<feedburner:origLink>http://avdi.org/devblog/2010/03/04/the-new-openness/</feedburner:origLink></item>
		<item>
		<title>Removing files with varied capitalization</title>
		<link>http://feedproxy.google.com/~r/VirtuousCode/~3/L3B1JaArCDU/</link>
		<comments>http://avdi.org/devblog/2010/03/03/removing-files-with-varied-capitalization/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 09:00:02 +0000</pubDate>
		<dc:creator>avdi</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://avdi.org/devblog/?p=514</guid>
		<description><![CDATA[Nothing ground-breaking today, just a one-liner that I expected to be longer than a one-liner.




# Remove Rakefile, rakefile, RakeFile, etc...
File.delete(*Dir.glob('rakefile', File::FNM_CASEFOLD))




There are two notable things going on here:

	Dir.glob can take optional bitflags; in this case, FNM_CASEFOLD means to ignore case.
	File.delete can take N arguments.
]]></description>
			<content:encoded><![CDATA[<p>Nothing ground-breaking today, just a one-liner that I expected to be longer than a one-liner.</p>



<pre name="code" class="ruby">
# Remove Rakefile, rakefile, RakeFile, etc...
File.delete(*Dir.glob('rakefile', File::FNM_CASEFOLD))
</pre>



There are two notable things going on here:<br />
<ol>
	<li><code>Dir.glob</code> can take optional bitflags; in this case, <code>FNM_CASEFOLD</code> means to ignore case.</li>
	<li><code>File.delete</code> can take N arguments.</li>
</ol><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=L3B1JaArCDU:PPjv0_opcmQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=L3B1JaArCDU:PPjv0_opcmQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=L3B1JaArCDU:PPjv0_opcmQ:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=L3B1JaArCDU:PPjv0_opcmQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=L3B1JaArCDU:PPjv0_opcmQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=L3B1JaArCDU:PPjv0_opcmQ:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=L3B1JaArCDU:PPjv0_opcmQ:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/VirtuousCode/~4/L3B1JaArCDU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://avdi.org/devblog/2010/03/03/removing-files-with-varied-capitalization/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/us/</creativeCommons:license>
	<feedburner:origLink>http://avdi.org/devblog/2010/03/03/removing-files-with-varied-capitalization/</feedburner:origLink></item>
		<item>
		<title>ruby-standard.org</title>
		<link>http://feedproxy.google.com/~r/VirtuousCode/~3/bFqFSKpqFqk/</link>
		<comments>http://avdi.org/devblog/2010/03/01/ruby-standard-org/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 06:14:34 +0000</pubDate>
		<dc:creator>avdi</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iso]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[standard]]></category>

		<guid isPermaLink="false">http://avdi.org/devblog/?p=511</guid>
		<description><![CDATA[So there&#8217;s this draft ISO standard for the Ruby language. Is it a good standard? Is it useful to implementors? Do we even need a standard? I don&#8217;t know, I don&#8217;t know, and I don&#8217;t know.

What I do know is that it&#8217;s hard to have a meaningful conversation about a document which exists only in [...]]]></description>
			<content:encoded><![CDATA[<p>So there&#8217;s this <a href="http://ruby-std.netlab.jp/">draft <span class="caps">ISO </span>standard</a> for the Ruby language. Is it a good standard? Is it useful to implementors? Do we even need a standard? I don&#8217;t know, I don&#8217;t know, and I don&#8217;t know.</p>

<p>What I <em>do</em> know is that it&#8217;s hard to have a meaningful conversation about a document which exists only in the form of a monolithic <span class="caps">PDF, </span>and for which the only public forum is an<a href="http://ruby-std.netlab.jp/projects/ruby-std/issues"> issue tracker</a>.</p>

<p>So I give you <a href="http://ruby-standard.org/">ruby-standard.org</a>. If you think that it&#8217;s helpful to the Ruby community to have a discussion about the standardization effort, I hope you&#8217;ll spend a few minutes helping to wikify the standard. If you think the standard is irrelevant, feel free to ignore this and move along. I don&#8217;t have an agenda with this; I just want to provide a place for the community to discuss the standard if it thinks the standard is worth discussing.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=bFqFSKpqFqk:FJ7CAefHA_g:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=bFqFSKpqFqk:FJ7CAefHA_g:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=bFqFSKpqFqk:FJ7CAefHA_g:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=bFqFSKpqFqk:FJ7CAefHA_g:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=bFqFSKpqFqk:FJ7CAefHA_g:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=bFqFSKpqFqk:FJ7CAefHA_g:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=bFqFSKpqFqk:FJ7CAefHA_g:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/VirtuousCode/~4/bFqFSKpqFqk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://avdi.org/devblog/2010/03/01/ruby-standard-org/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/us/</creativeCommons:license>
	<feedburner:origLink>http://avdi.org/devblog/2010/03/01/ruby-standard-org/</feedburner:origLink></item>
		<item>
		<title>Getting Pedantic About Ruby Semantics</title>
		<link>http://feedproxy.google.com/~r/VirtuousCode/~3/-cmXb_F-KeA/</link>
		<comments>http://avdi.org/devblog/2010/03/01/getting-pedantic-about-ruby-semantics/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 09:00:41 +0000</pubDate>
		<dc:creator>avdi</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[semantics]]></category>

		<guid isPermaLink="false">http://avdi.org/devblog/?p=489</guid>
		<description><![CDATA[I just can&#8217;t resist the tempation to be an asshole language lawyer.

Yehuda thinks that it&#8217;s important to keep a semantic model of Ruby behavior in mind, and not get hung up on implementation details. He&#8217;s right. While it&#8217;s important to understand the implementation, with a half a dozen or more different implementations of Ruby out [...]]]></description>
			<content:encoded><![CDATA[<p>I just can&#8217;t resist the tempation to be an <del datetime="2010-02-27T17:56:36+00:00"><a href="http://diveintomark.org/archives/2004/08/16/specs">asshole</a></del> <a href="http://catb.org/jargon/html/L/language-lawyer.html">language lawyer</a>.</p>

<p>Yehuda <a href="http://yehudakatz.com/2010/02/25/rubys-implementation-does-not-define-its-semantics/">thinks that it&#8217;s important to keep a semantic model of Ruby behavior in mind</a>, and not get hung up on implementation details. He&#8217;s right. While it&#8217;s important to understand the implementation, with a half a dozen or more different implementations of Ruby out there, it&#8217;s more and more important that we understand the semantics of Ruby as a language separately from Matz&#8217; Ruby Interpreter (MRI).</p>

<p>The best resource we have for determining the semantics of Ruby-as-a-language is the <a href="http://ruby-std.netlab.jp/draft_spec/agreement.html">draft <span class="caps">ISO </span>standard</a>. The draft standard is <a href="http://joefiorini.com/post/266523563/the-ruby-draft-specification">not without it&#8217;s problems</a>, not the least of which is that wider Ruby community hasn&#8217;t exactly been encouraged to participate in the standards process. But it&#8217;s the closest thing we have to a definition of Ruby&#8217;s semantics divorced from any specific implementation. I looked up the parts of the standard which pertain to blocks, in order to see if Yehuda&#8217;s mental model of Ruby agrees with that of the creator of Ruby. </p>

<p>Here&#8217;s the part defining blocks:</p>

<blockquote>
<strong>11.2.2 Blocks</strong>

<p>[...]</p>

<p><strong>Semantics</strong><br />
A block is a sequence of statements or expressions passed to a method invocation. A block can be called either by a yield-expression (see &Acirc;&sect;11.2.4) or by invoking the method call on an instance of the class Proc which is created by an invocation of the method Proc.new to which the block is passed (see &Acirc;&sect;15.2.17.3.3).</p>

</blockquote>

<p>And here&#8217;s the part which specifies the semantics of <code>&amp;block</code> arguments:</p>

<blockquote>
<strong>A block parameter</strong>: This parameter is represented by block-parameter-name. The parameter is bound to the block passed to the method invocation.

<p>[...]</p>

<p>13.3.3  Method invocation</p>

<p>The way in which a list of arguments is created are described in &Acirc;&sect;11.2.</p>

<p>Given the receiver R, the method name M, and the list of arguments A, take the following steps:</p>

<p>a)  If the method is invoked with a block, let B be the block. Otherwise, let B be block-not-given.</p>

<p>[...]</p>

<p>Push B onto [[block]]. <ins>[This is a notational convention indicating an attribute of an execution context -Ed].</ins></p>

<p>[...]<br />
iv) If the block-parameter of L occurs, let D be the top of [[block]] .</p>

<p>I)   If D is block-not-given, let V be nil.</p>

<p>II) Otherwise, invoke the method <code>new</code> on the class <code>Proc</code> with an empty list of arguments and D as the block. Let V be the resulting value of the method invocation.</p>

<p><span class="caps">III</span>) Let n be the block-parameter-name of block-parameter.</p>

<p>IV) Create a variable binding with name n and value V in Sb .</p>

</blockquote>

<p>As I read the standard, Yehuda is incorrect in his interpretation of Ruby block semantics. Blocks are non-object entities which form one of the attributes of an execution context. If the method provides a name for the block in the form of an <code>&amp;block</code> parameter, then and only then is an object created, by explicitly calling <code>Proc.new</code>.</p>

<p>Does it matter that this model differs from Yehuda&#8217;s? In at least one respect it does. Yehuda points out that in <span class="caps">MRI, </span>the <code>object_id</code> of a given block is always the same even. By my read of the standard, this is an optimization, and <em>not</em> something to rely on as a part of Ruby&#8217;s semantics.</p>

<p>But that&#8217;s not the end of the story. The stated intent of the Ruby <span class="caps">ISO </span>standard is to formally describe the the behavior of <span class="caps">MRI</span> 1.8.7.  So does it, in this case? Let&#8217;s see:</p>



<pre name="code" class="ruby">
class &lt; &lt; Proc
  alias old_new new
  def new(&amp;block)
    puts &quot;in Proc.new&quot;
    old_new(&amp;block)
  end
end

def foo(&amp;block)
  puts &quot;In foo&quot;
  bar(&amp;block)
end

def bar(&amp;block)
  puts &quot;In bar&quot;
  block.call
end

foo do
  puts &quot;In block&quot;
end

# &gt;&gt; In foo
# &gt;&gt; In bar
# &gt;&gt; In block
</pre>



<p>It certainly doesn&#8217;t look like <code>Proc.new</code> is being called here. Now, whether this is because <span class="caps">MRI </span>is not flexible enough to enable an effective redefinition of <code>Proc.new</code>, or whether <code>Proc.new</code> is never called, is unclear without the assistance of a C-level debugger. If the latter, then Yehuda&#8217;s mental model is closer to the real behavior of <span class="caps">MRI </span>than the draft standard.</p>

<p>And when standards no more reflect reality than any given hacker&#8217;s imagination, the  question becomes: what semantics do you think the language <em>should</em> have, moving forward? As a statement of what he thinks the semantics <em>ought</em> be, I personally think Yehuda&#8217;s mental model is pretty reasonable, and consistent with Ruby&#8217;s &#8220;everything is an object&#8221; philosophy. But stating that it is the canonical semantics of the language upon which Ruby hackers should base their assumptions &#8211; that seems a bit presumptuous to me.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=-cmXb_F-KeA:6Nw3SkVDJcE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=-cmXb_F-KeA:6Nw3SkVDJcE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=-cmXb_F-KeA:6Nw3SkVDJcE:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=-cmXb_F-KeA:6Nw3SkVDJcE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=-cmXb_F-KeA:6Nw3SkVDJcE:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=-cmXb_F-KeA:6Nw3SkVDJcE:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=-cmXb_F-KeA:6Nw3SkVDJcE:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/VirtuousCode/~4/-cmXb_F-KeA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://avdi.org/devblog/2010/03/01/getting-pedantic-about-ruby-semantics/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/us/</creativeCommons:license>
	<feedburner:origLink>http://avdi.org/devblog/2010/03/01/getting-pedantic-about-ruby-semantics/</feedburner:origLink></item>
		<item>
		<title>Calling Grandparents in Ruby</title>
		<link>http://feedproxy.google.com/~r/VirtuousCode/~3/eypqQc0bdRU/</link>
		<comments>http://avdi.org/devblog/2010/02/25/calling-grandparents-in-ruby/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 15:38:20 +0000</pubDate>
		<dc:creator>avdi</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[inheritance]]></category>
		<category><![CDATA[invocation]]></category>
		<category><![CDATA[methods]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://avdi.org/devblog/?p=386</guid>
		<description><![CDATA[I&#8217;m not the first to post about this, but it&#8217;s worth re-posting since not everyone knows how to do it.

Ruby makes it easy to call an objects&#8217; superclass methods:




class Parent
  def foo
    # ...
  end
end

class Child &#60; Parent
  def foo
    super
  end
end




But what if we [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not the first to post about this, but it&#8217;s worth re-posting since not everyone knows how to do it.</p>

<p>Ruby makes it easy to call an objects&#8217; superclass methods:</p>



<pre name="code" class="ruby">
class Parent
  def foo
    # ...
  end
end

class Child &lt; Parent
  def foo
    super
  end
end
</pre>



<p>But what if we want to call the super-superclass method, skipping over the superclass definition? Or what if an included module has overridden the superclass method?</p>

</pre>

<pre name="code" class="ruby">
class Parent
  def foo
    # ...
  end
end

module Interloper
  def foo
    puts &quot;Bwahaha all your foos are belong to us!&quot;
  end
end

class Child &lt; Parent
  include Interloper

  def foo
    # ???
  end
end
</pre>



<p>You can do it, of course (this is Ruby); but the means may not be immediately obvious:</p>

</pre>

<pre name="code" class="ruby">
class Child &lt; Parent
  include Interloper

  def foo
    Parent.instance_method(:foo).bind(self).call
  end
end
</pre>



If it's not clear what's going on here: we're creating an <code>UnboundMethod</code> object representing the <code>Parent#foo</code> method, binding that method to the child class instance, and immediately invoking it. It's a bit unwieldy, but when you want to be absolutely sure of which method implementation you are calling, this is the best way to go.</pre><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=eypqQc0bdRU:oJEOEvfHIT8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=eypqQc0bdRU:oJEOEvfHIT8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=eypqQc0bdRU:oJEOEvfHIT8:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=eypqQc0bdRU:oJEOEvfHIT8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=eypqQc0bdRU:oJEOEvfHIT8:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=eypqQc0bdRU:oJEOEvfHIT8:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=eypqQc0bdRU:oJEOEvfHIT8:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/VirtuousCode/~4/eypqQc0bdRU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://avdi.org/devblog/2010/02/25/calling-grandparents-in-ruby/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/us/</creativeCommons:license>
	<feedburner:origLink>http://avdi.org/devblog/2010/02/25/calling-grandparents-in-ruby/</feedburner:origLink></item>
		<item>
		<title>Come see me in Harrisburg tonight!</title>
		<link>http://feedproxy.google.com/~r/VirtuousCode/~3/RzuSZfWyUrs/</link>
		<comments>http://avdi.org/devblog/2010/02/18/come-see-me-in-harrisburg-tonight/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 17:14:41 +0000</pubDate>
		<dc:creator>avdi</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[talks]]></category>

		<guid isPermaLink="false">http://avdi.org/devblog/?p=478</guid>
		<description><![CDATA[If you&#8217;re in the central PA region and interested in learning some techniques for making your Ruby coding style cleaner and more confident, come see me speak tonight at the Harrisburg Ruby Group. I&#8217;ll be delivering an improved and reorganized version of the Confident Code talk I gave last month at B&#8217;More on Rails.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re in the central PA region and interested in learning some techniques for making your Ruby coding style cleaner and more confident, come see me speak tonight at the <a href="http://ruby.meetup.com/102/">Harrisburg Ruby Group</a>. I&#8217;ll be delivering an improved and reorganized version of the Confident Code talk I gave last month at <span class="caps">B&#8217;M</span>ore on Rails.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=RzuSZfWyUrs:hMgoNBnxSkA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=RzuSZfWyUrs:hMgoNBnxSkA:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=RzuSZfWyUrs:hMgoNBnxSkA:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=RzuSZfWyUrs:hMgoNBnxSkA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=RzuSZfWyUrs:hMgoNBnxSkA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=RzuSZfWyUrs:hMgoNBnxSkA:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=RzuSZfWyUrs:hMgoNBnxSkA:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/VirtuousCode/~4/RzuSZfWyUrs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://avdi.org/devblog/2010/02/18/come-see-me-in-harrisburg-tonight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/us/</creativeCommons:license>
	<feedburner:origLink>http://avdi.org/devblog/2010/02/18/come-see-me-in-harrisburg-tonight/</feedburner:origLink></item>
		<item>
		<title>Looking for a new NullDB maintainer</title>
		<link>http://feedproxy.google.com/~r/VirtuousCode/~3/Fon1iwEAn2U/</link>
		<comments>http://avdi.org/devblog/2010/02/16/looking-for-a-new-nulldb-maintainer/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 14:44:04 +0000</pubDate>
		<dc:creator>avdi</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[activerecord]]></category>
		<category><![CDATA[datamapper]]></category>
		<category><![CDATA[floss]]></category>
		<category><![CDATA[nulldb]]></category>
		<category><![CDATA[oss]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://avdi.org/devblog/?p=473</guid>
		<description><![CDATA[I love Open Source. NullDB, a weekend hack that I barely touched after its first version, continues to attract periodic forks and patches. For a long time I&#8217;ve been meaning to sit down and roll in all the contributions that people have made over the last couple of years.

But I realized something yesterday. I haven&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_474" class="wp-caption aligncenter" style="width: 352px"><a href="http://github.com/avdi/nulldb"><img src="http://avdi.org/devblog/wp-content/uploads/2010/02/nulldb-tree.png" alt="NullDB network on Github" title="nulldb-tree" width="342" height="219" class="size-full wp-image-474" /></a><p class="wp-caption-text">NullDB network on Github</p></div></p>

<p>I love Open Source. <a href="http://nulldb.rubyforge.org/">NullDB</a>, a weekend hack that I barely touched after its first version, continues to attract periodic forks and patches. For a long time I&#8217;ve been meaning to sit down and roll in all the contributions that people have made over the last couple of years.</p>

<p>But I realized something yesterday. I haven&#8217;t used ActiveRecord for anything serious for around a year. And I can&#8217;t imagine choosing to use ActiveRecord for any projects in the future, because I literally can&#8217;t think of a single scenario in which AR is a better choice than <a href="http://datamapper.org">DataMapper</a>. (Just as an example of DataMapper&#8217;s awesomeness: it turns out NullDB isn&#8217;t even needed for DataMapper, because <a href="http://avdi.org/devblog/2009/10/27/nulldb-for-datamapper/">you get it for free</a>).</p>

<p>There isn&#8217;t a foreseeable future in which I&#8217;ll be using NullDB regularly, and if I&#8217;m not using it it&#8217;s never going to be a priority for me. Which, realistically, means it&#8217;s never going to have my attention.</p>

I think the time has come to turn NullDB over to a new maintainer, someone who has a more active interest in testing ActiveRecord-based codebases. The ideal candidate would:<br />
<ol>
	<li>Be using NullDB on a daily basis.</li>
	<li>Have submitted at least one <strong>tested</strong> NullDB patch.</li>
	<li>Be committed to the NullDB philosophy of preferring public <span class="caps">API</span>s to fragile monkeypatching.</li>
</ol>

<p>If you think this describes you and you are interested in becoming the NullDB maintainer, please get in touch.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=Fon1iwEAn2U:XziFygGW8X8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=Fon1iwEAn2U:XziFygGW8X8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=Fon1iwEAn2U:XziFygGW8X8:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=Fon1iwEAn2U:XziFygGW8X8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=Fon1iwEAn2U:XziFygGW8X8:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=Fon1iwEAn2U:XziFygGW8X8:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=Fon1iwEAn2U:XziFygGW8X8:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/VirtuousCode/~4/Fon1iwEAn2U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://avdi.org/devblog/2010/02/16/looking-for-a-new-nulldb-maintainer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/us/</creativeCommons:license>
	<feedburner:origLink>http://avdi.org/devblog/2010/02/16/looking-for-a-new-nulldb-maintainer/</feedburner:origLink></item>
		<item>
		<title>RubyPulse</title>
		<link>http://feedproxy.google.com/~r/VirtuousCode/~3/uQkY38UKtJ8/</link>
		<comments>http://avdi.org/devblog/2010/02/10/rubypulse/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 14:00:23 +0000</pubDate>
		<dc:creator>avdi</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[podcasts]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://avdi.org/devblog/?p=470</guid>
		<description><![CDATA[Rubyists: are you watching RubyPulse regularly? This show has rapidly become one of my must-see screencasts. Each episode is just a few minutes long, and demonstrates just enough of a useful Rubygem to give you an idea of what it is and what it&#8217;s good for. As someone who dislikes lengthy tutorial videos (I prefer [...]]]></description>
			<content:encoded><![CDATA[<p>Rubyists: are you watching <a href="http://www.rubypulse.com/">RubyPulse</a> regularly? This show has rapidly become one of my must-see screencasts. Each episode is just a few minutes long, and demonstrates just enough of a useful Rubygem to give you an idea of what it is and what it&#8217;s good for. As someone who dislikes lengthy tutorial videos (I prefer textual documentation for in-depth learning), I find these to be the perfect length.  Highly recommended.</p>

<p>(Disclaimer: my <a href="http://avdi.org/devblog/2010/01/18/hammertime/">Hammertime</a> gem has been a featured project.)</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=uQkY38UKtJ8:6hg-tgmMwR0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=uQkY38UKtJ8:6hg-tgmMwR0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=uQkY38UKtJ8:6hg-tgmMwR0:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=uQkY38UKtJ8:6hg-tgmMwR0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=uQkY38UKtJ8:6hg-tgmMwR0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=uQkY38UKtJ8:6hg-tgmMwR0:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=uQkY38UKtJ8:6hg-tgmMwR0:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/VirtuousCode/~4/uQkY38UKtJ8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://avdi.org/devblog/2010/02/10/rubypulse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/us/</creativeCommons:license>
	<feedburner:origLink>http://avdi.org/devblog/2010/02/10/rubypulse/</feedburner:origLink></item>
		<item>
		<title>Everything You Love about Java is Everything I Love About Good Design</title>
		<link>http://feedproxy.google.com/~r/VirtuousCode/~3/697dJjjEm0k/</link>
		<comments>http://avdi.org/devblog/2010/02/09/everything-you-love-about-java-is-everything-i-love-about-good-design/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 13:57:54 +0000</pubDate>
		<dc:creator>avdi</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[patterns]]></category>
		<category><![CDATA[practices]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://avdi.org/devblog/?p=462</guid>
		<description><![CDATA[I just read Why I love everything you hate about Java. You should too. There are some very good points about modularity in there.

Unfortunately they are all mixed up with some unnecessarily combative us-vs-them rhetoric. Apparently in Nick Kallen&#8217;s view, as a Rubyist I slap my hands over my ears and start rocking back and [...]]]></description>
			<content:encoded><![CDATA[<p>I just read <a href="http://magicscalingsprinkles.wordpress.com/2010/02/08/why-i-love-everything-you-hate-about-java/">Why I love everything you hate about Java</a>. You should too. There are some very good points about modularity in there.</p>

<p>Unfortunately they are all mixed up with some unnecessarily combative us-vs-them rhetoric. Apparently in Nick Kallen&#8217;s view, as a Rubyist I slap my hands over my ears and start rocking back and forth when I hear the words &#8220;Dependency Injection&#8221; or &#8220;Factory&#8221;.</p>

<p>Let us be clear. If you are a Rubyist and your hackles <em>do</em> rise at the phrase &#8220;Dependency Injection&#8221;, you need to check yourself. Using a dynamic language shouldn&#8217;t mean throwing the <a href="http://www.amazon.com/gp/product/0201633612?ie=UTF8&amp;tag=thlafa-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0201633612">Gang of Four</a><img src="http://www.assoc-amazon.com/e/ir?t=thlafa-20&amp;l=as2&amp;o=1&amp;a=0201633612" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;"/> out the window. And anyway, you probably use software daily &#8211; such as Rails &#8211; which is just <em>lousy</em> with <a href="http://martinfowler.com/eaaCatalog/activeRecord.html">enterprise design patterns</a>.</p>

<p>The patterns Nick cites &#8211; Dependency Injection, Factory, and Decorator &#8211; are patterns I use daily. They are some of my favorites, to the point that they are practically second nature. For instance, here&#8217;s a paraphrased and simplified example from some production code I wrote:</p>



<pre name="code" class="ruby">
def execute_shell_command(command_line, options={})
  shell_command_maker = options.fetch(:shell_command_maker) {
    ShellCommand.method(:new)
  }

  command = shell_command_maker.call(command_line, options)
  command.execute!
end
</pre>



<p>This example combines Factory and Dependency Injection and tops them with some Convention Over Configuration sauce. The dependency on a command line object is injectable, and we inject it by passing in an optional factory named <code>:shell_command_maker</code>. This factory, rather than having to be a Factory class, can be any callable object &#8211; such as a lambda. If no option is specified, the code uses <code>ShellCommand.new()</code> to instantiate the object. We can inject a different command line class:</p>



<pre name="code" class="ruby">
execute_shell_command(&quot;ls&quot;, :shell_command_maker =&gt; RemoteCommand.method(:new))
</pre>



<p>But we can just as easily inject something fancier. Lets inject a <code>ShellCommand</code> wrapped in a logging <a href="http://c2.com/cgi/wiki?DecoratorPattern">Decorator</a>:</p>



<pre name="code" class="ruby">
require 'delegator'
class CommandLogger &lt; SimpleDelegator
  def initialize(shell_command, logger=Logger.new($stderr))
    @command = command_line
    @logger = logger
    super(shell_command)
  end

  def execute!
    @logger.info &quot;Executing '#{@command}'&quot;
    super
  end
end

logger = Logger.new($stdout)
make_logged_shell_command = lambda do |command_line, options|
  CommandLogger.new(ShellCommand.new(command_line, options), logger)
end
options = {
  :shell_command_maker =&gt; make_logged_shell_command
}
execute_shell_command(&quot;ls&quot;, options)
execute_shell_command(&quot;ps aux&quot;, options)
# ...
</pre>



<p>What I find repugnant about Java development is not the use of industrial strength patterns, but the fact that using those patterns in Java is so awkward, high-ceremony and obtrusive that people wind up writing <a href="http://www.amazon.com/gp/product/193398855X?ie=UTF8&amp;tag=thlafa-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=193398855X">entire books</a><img src="http://www.assoc-amazon.com/e/ir?t=thlafa-20&amp;l=as2&amp;o=1&amp;a=193398855X" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> on simple concepts such as <a href="http://c2.com/cgi/wiki?DependencyInjection">dependency injection</a>. A fact which Nick seems to have grasped as well, since he&#8217;s writing his examples in Scala, a language with a level of expressiveness similar to that of Ruby.</p>

<p>The Java ecosystem warps your brain into a mode of thinking where modularity patterns like DI and decoration are like ancient gods which can only be invoked with a great deal of pomp and ceremony. And I think that perspective tends to make it hard to see that other programmers use the same patterns, just with less fanfare. For an even better take on this topic than mine, read Jamis Buck&#8217;s <a href="http://weblog.jamisbuck.org/2008/11/9/legos-play-doh-and-programming">classic account</a> of writing and discarding two Ruby DI frameworks.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=697dJjjEm0k:w0msZ50UhWU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=697dJjjEm0k:w0msZ50UhWU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=697dJjjEm0k:w0msZ50UhWU:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=697dJjjEm0k:w0msZ50UhWU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=697dJjjEm0k:w0msZ50UhWU:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=697dJjjEm0k:w0msZ50UhWU:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=697dJjjEm0k:w0msZ50UhWU:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/VirtuousCode/~4/697dJjjEm0k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://avdi.org/devblog/2010/02/09/everything-you-love-about-java-is-everything-i-love-about-good-design/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/us/</creativeCommons:license>
	<feedburner:origLink>http://avdi.org/devblog/2010/02/09/everything-you-love-about-java-is-everything-i-love-about-good-design/</feedburner:origLink></item>
		<item>
		<title>Cargo Cults and Dharma Transmission</title>
		<link>http://feedproxy.google.com/~r/VirtuousCode/~3/6amS72WIUWk/</link>
		<comments>http://avdi.org/devblog/2010/02/08/cargo-cults-and-dharma-transmission/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 14:00:40 +0000</pubDate>
		<dc:creator>avdi</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dharma]]></category>
		<category><![CDATA[practices]]></category>

		<guid isPermaLink="false">http://avdi.org/devblog/?p=450</guid>
		<description><![CDATA[Here&#8217;s a pattern I see a lot in discussions of development practices:


Skeptic:I&#8217;ve tried practice X, and it doesn&#8217;t work
Believer:What do you mean it doesn&#8217;t work?  It works for me and everyone I know. You must be doing it wrong.
Skeptic:Nonsense. I did it exactly the way the book says to do it. You&#8217;re just a [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a pattern I see a lot in discussions of development practices:</p>

<p><dialog><br />
<dt>Skeptic:</dt><dd>I&#8217;ve tried practice X, and it doesn&#8217;t work</dd><br />
<dt>Believer:</dt><dd>What do you mean it doesn&#8217;t work?  It works for me and everyone I know. You must be doing it wrong.</dd><br />
<dt>Skeptic:</dt><dd>Nonsense<strong>. I did it exactly the way the book says to do it</strong>. You&#8217;re just a blinded by the kool-aid.</dd><br />
<dt>Believer:</dt><dd>Unprofessional lout.</dd><br />
<dt>Skeptic:</dt><dd>Deluded imbecile.</dd><br />
<dt>Believer:</dt><dd>I know you are, but what am I?</dd><br />
</dialog></p>

<p>You get the idea.</p>

<p>I highlighted what I think is the key point n this conversation: the fact that the Skeptic learned about Practice X from a book.  It could just as well have been a Wikipedia article or a series of blog posts. The point is that our Skeptic tried to put into practice something which he had never witnessed first-hand, and was disappointed at the results.</p>

<p>It strikes me that there is a form of <a href="http://c2.com/cgi/wiki?CargoCultProgramming">cargo-culting</a> going on here. Only in this case, when the cargo planes fail to arrive, the cultists experience an understandable crisis of faith. Sometimes followed by a period of angry backlash against the&#8221;faithful&#8221;.</p>

<p>In some Buddhist traditions the concept of &#8220;<a href="http://en.wikipedia.org/wiki/Dharma_transmission">Dharma transmission</a>&#8221; is held to be central.  A Dharma transmission is the direct person-to-person teaching from master to student. A teaching is regarded as true and authentic if a lineage of direct transmissions can be traced, teacher to teacher, all the way back to Sakyamuni Buddha himself.</p>

<p>Dharma transmission cannot occur through reading holy books. It must occur in person.  I think this may sometimes be true of software development practices as well.  We have a wealth of books and articles on best practices.  You can learn everything there is to know about Test-Driven Development or Separation of Concerns without ever leaving your desk. But without sitting down with a master and working through a real-world problem, you risk missing that moment of enlightenment when everything clicks into place.</p>

<p>I&#8217;m usually quick to say &#8220;you&#8217;re doing it wrong; read more and try again&#8221; when I see people complaining about practices that I find profoundly beneficial.  But maybe that isn&#8217;t helpful. Maybe some understandings can only be effectively passed by direct transmission. </p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=6amS72WIUWk:Q5WiJbRlQ-U:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=6amS72WIUWk:Q5WiJbRlQ-U:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=6amS72WIUWk:Q5WiJbRlQ-U:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=6amS72WIUWk:Q5WiJbRlQ-U:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?i=6amS72WIUWk:Q5WiJbRlQ-U:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=6amS72WIUWk:Q5WiJbRlQ-U:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/VirtuousCode?a=6amS72WIUWk:Q5WiJbRlQ-U:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/VirtuousCode?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/VirtuousCode/~4/6amS72WIUWk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://avdi.org/devblog/2010/02/08/cargo-cults-and-dharma-transmission/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/us/</creativeCommons:license>
	<feedburner:origLink>http://avdi.org/devblog/2010/02/08/cargo-cults-and-dharma-transmission/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 1.142 seconds -->
