<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: method_missing: best saved for last</title>
	<atom:link href="http://labnotes.org/2007/02/06/method_missing-best-saved-for-last/feed/" rel="self" type="application/rss+xml" />
	<link>http://labnotes.org/2007/02/06/method_missing-best-saved-for-last/</link>
	<description></description>
	<lastBuildDate>Fri, 12 Mar 2010 02:57:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: &#187; Putting the client before the technology, by putting the right technology before the client &#124; IT Consultant &#124; TechRepublic.com</title>
		<link>http://labnotes.org/2007/02/06/method_missing-best-saved-for-last/comment-page-1/#comment-138276</link>
		<dc:creator>&#187; Putting the client before the technology, by putting the right technology before the client &#124; IT Consultant &#124; TechRepublic.com</dc:creator>
		<pubDate>Mon, 20 Aug 2007 17:46:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2007/02/06/method_missing-best-saved-for-last/#comment-138276</guid>
		<description>[...] anything you want, even modify the framework itself or all classes in general (sometimes with unintended consequences).Â  So before you can recommend usingÂ Ruby for a project, you have to know that your client can [...]</description>
		<content:encoded><![CDATA[<p>[...] anything you want, even modify the framework itself or all classes in general (sometimes with unintended consequences).Â  So before you can recommend usingÂ Ruby for a project, you have to know that your client can [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://labnotes.org/2007/02/06/method_missing-best-saved-for-last/comment-page-1/#comment-137659</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Wed, 28 Feb 2007 23:30:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2007/02/06/method_missing-best-saved-for-last/#comment-137659</guid>
		<description>A word about terminology: If you call it &quot;monkeypatching&quot; then you probably do not understand it well enough to be using it.</description>
		<content:encoded><![CDATA[<p>A word about terminology: If you call it &#8220;monkeypatching&#8221; then you probably do not understand it well enough to be using it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stoffe</title>
		<link>http://labnotes.org/2007/02/06/method_missing-best-saved-for-last/comment-page-1/#comment-137645</link>
		<dc:creator>Stoffe</dc:creator>
		<pubDate>Sun, 25 Feb 2007 20:21:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2007/02/06/method_missing-best-saved-for-last/#comment-137645</guid>
		<description>Seems pretty obvious that it&#039;s Rake that is broken and should be fixed.</description>
		<content:encoded><![CDATA[<p>Seems pretty obvious that it&#8217;s Rake that is broken and should be fixed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Assaf</title>
		<link>http://labnotes.org/2007/02/06/method_missing-best-saved-for-last/comment-page-1/#comment-137604</link>
		<dc:creator>Assaf</dc:creator>
		<pubDate>Tue, 13 Feb 2007 01:00:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2007/02/06/method_missing-best-saved-for-last/#comment-137604</guid>
		<description>James, thanks for the tip.

I couldn&#039;t find a link to the presentation, but I did find &lt;a href=&quot;http://www.ethelred.org/articles/2006/09/17/railsconf-playing-it-safe&quot;&gt;notes of the talk&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>James, thanks for the tip.</p>
<p>I couldn&#8217;t find a link to the presentation, but I did find <a href="http://www.ethelred.org/articles/2006/09/17/railsconf-playing-it-safe">notes of the talk</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aristotle</title>
		<link>http://labnotes.org/2007/02/06/method_missing-best-saved-for-last/comment-page-1/#comment-137600</link>
		<dc:creator>Aristotle</dc:creator>
		<pubDate>Mon, 12 Feb 2007 05:53:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2007/02/06/method_missing-best-saved-for-last/#comment-137600</guid>
		<description>I agree with Chris here: the problem is Rake monkeypatching Object, which it has no business touching.

Monkeypatching seems like a serious illness of the Ruby community; unlike the stodgy Java types, I firmly believe it is essential to be &lt;em&gt;able&lt;/em&gt; to do it, but I also firmly believe itâ€™s a strategy of last resort. &lt;em&gt;Last&lt;/em&gt; resort. And it should never ever be done by a library or framework; only by application code which is standalone and wonâ€™t be mixed with other code down the line, or as part of a metaprogramming abstraction. Otherwise, you get clashes and interactions like this one.

&lt;code&gt;method_missing&lt;/code&gt;, in contrast, is perfectly fine. I use it quite frequently without any ill effects (or rather its equivalent in my preferred language). In fact, itâ€™s a prime enabler of OO metaprogramming; things like proxies and mock objects are impossible without it.</description>
		<content:encoded><![CDATA[<p>I agree with Chris here: the problem is Rake monkeypatching Object, which it has no business touching.</p>
<p>Monkeypatching seems like a serious illness of the Ruby community; unlike the stodgy Java types, I firmly believe it is essential to be <em>able</em> to do it, but I also firmly believe itâ€™s a strategy of last resort. <em>Last</em> resort. And it should never ever be done by a library or framework; only by application code which is standalone and wonâ€™t be mixed with other code down the line, or as part of a metaprogramming abstraction. Otherwise, you get clashes and interactions like this one.</p>
<p><code>method_missing</code>, in contrast, is perfectly fine. I use it quite frequently without any ill effects (or rather its equivalent in my preferred language). In fact, itâ€™s a prime enabler of OO metaprogramming; things like proxies and mock objects are impossible without it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Mead</title>
		<link>http://labnotes.org/2007/02/06/method_missing-best-saved-for-last/comment-page-1/#comment-137587</link>
		<dc:creator>James Mead</dc:creator>
		<pubDate>Sat, 10 Feb 2007 22:19:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2007/02/06/method_missing-best-saved-for-last/#comment-137587</guid>
		<description>Oops that should have been RailsConf Europe 2006</description>
		<content:encoded><![CDATA[<p>Oops that should have been RailsConf Europe 2006</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Mead</title>
		<link>http://labnotes.org/2007/02/06/method_missing-best-saved-for-last/comment-page-1/#comment-137586</link>
		<dc:creator>James Mead</dc:creator>
		<pubDate>Sat, 10 Feb 2007 20:18:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2007/02/06/method_missing-best-saved-for-last/#comment-137586</guid>
		<description>Interesting post. Jim Weirich (author of Rake) gave a talk at RailsConf 2007 entitled &quot;Playing it safe&quot; which was all about how to design libraries so they don&#039;t interfere unexpectedly with other libraries. He illustrated his talk with things he&#039;d done in Rake which he now regrets!</description>
		<content:encoded><![CDATA[<p>Interesting post. Jim Weirich (author of Rake) gave a talk at RailsConf 2007 entitled &#8220;Playing it safe&#8221; which was all about how to design libraries so they don&#8217;t interfere unexpectedly with other libraries. He illustrated his talk with things he&#8217;d done in Rake which he now regrets!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Labnotes &#187; Rounded Corners - 103</title>
		<link>http://labnotes.org/2007/02/06/method_missing-best-saved-for-last/comment-page-1/#comment-137577</link>
		<dc:creator>Labnotes &#187; Rounded Corners - 103</dc:creator>
		<pubDate>Fri, 09 Feb 2007 08:15:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2007/02/06/method_missing-best-saved-for-last/#comment-137577</guid>
		<description>[...] of the trade. Kellan Elliott-McCrea read method_missing and wrote his assesment of the situation. &#8220;I take this as being a symptom of the Ruby design [...]</description>
		<content:encoded><![CDATA[<p>[...] of the trade. Kellan Elliott-McCrea read method_missing and wrote his assesment of the situation. &#8220;I take this as being a symptom of the Ruby design [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Assaf</title>
		<link>http://labnotes.org/2007/02/06/method_missing-best-saved-for-last/comment-page-1/#comment-137571</link>
		<dc:creator>Assaf</dc:creator>
		<pubDate>Thu, 08 Feb 2007 03:28:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2007/02/06/method_missing-best-saved-for-last/#comment-137571</guid>
		<description>Chris,

You&#039;re right, Net::SFTP works well everywhere else, it&#039;s only Rake (that I know of) that breaks it.

But when something breaks you have to fix it. I&#039;m trying to learn by example so I can create code that -- when it breaks, and most likely it would -- will be easy to fix.

Figuring out what Rake does was easy, I just looked at the docs (document that which you extend). Figuring out what Net::SFTP is doing took a long while, digging through its code in search of the elusive mkdir that doesn&#039;t exist, and then having to understand how it works to figure out the two patches.

And thanks for pointing out the confusion about stubbing.

I use RSpec for the test suite, it&#039;s awesome and I love writing tests with it. The tests I&#039;m referring to here were done by running the code against a live server and seeing what happens, so no mocking or stubbing involved.</description>
		<content:encoded><![CDATA[<p>Chris,</p>
<p>You&#8217;re right, Net::SFTP works well everywhere else, it&#8217;s only Rake (that I know of) that breaks it.</p>
<p>But when something breaks you have to fix it. I&#8217;m trying to learn by example so I can create code that &#8212; when it breaks, and most likely it would &#8212; will be easy to fix.</p>
<p>Figuring out what Rake does was easy, I just looked at the docs (document that which you extend). Figuring out what Net::SFTP is doing took a long while, digging through its code in search of the elusive mkdir that doesn&#8217;t exist, and then having to understand how it works to figure out the two patches.</p>
<p>And thanks for pointing out the confusion about stubbing.</p>
<p>I use RSpec for the test suite, it&#8217;s awesome and I love writing tests with it. The tests I&#8217;m referring to here were done by running the code against a live server and seeing what happens, so no mocking or stubbing involved.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Anderson</title>
		<link>http://labnotes.org/2007/02/06/method_missing-best-saved-for-last/comment-page-1/#comment-137570</link>
		<dc:creator>Chris Anderson</dc:creator>
		<pubDate>Thu, 08 Feb 2007 02:50:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labnotes.org/2007/02/06/method_missing-best-saved-for-last/#comment-137570</guid>
		<description>I think the real issue is Rake polluting Object with a bunch of FileUtil stuff.

Using method_missing to dispatch to underlying implementations is fine, especially if you don&#039;t know what methods those implementations will support. See for example the EVDB Ruby API client. My choice would be to use explicit delegation whenever I know the methods I&#039;m expecting to use, but Net:SFTP isn&#039;t changing anytime soon.

And I think the other Chris meant something else by stubbing, than the sense in which you used it. Maybe the term mocking is more appropriate for his usage. The basic idea being that if the SFTP implementation expects :mkdir, then your tests won&#039;t satisfy the expectation. Checkout RSpec and Mocha, both sweet mocking frameworks.</description>
		<content:encoded><![CDATA[<p>I think the real issue is Rake polluting Object with a bunch of FileUtil stuff.</p>
<p>Using method_missing to dispatch to underlying implementations is fine, especially if you don&#8217;t know what methods those implementations will support. See for example the EVDB Ruby API client. My choice would be to use explicit delegation whenever I know the methods I&#8217;m expecting to use, but Net:SFTP isn&#8217;t changing anytime soon.</p>
<p>And I think the other Chris meant something else by stubbing, than the sense in which you used it. Maybe the term mocking is more appropriate for his usage. The basic idea being that if the SFTP implementation expects :mkdir, then your tests won&#8217;t satisfy the expectation. Checkout RSpec and Mocha, both sweet mocking frameworks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
