<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
	>
<channel>
	<title>Comments on: Calling Grandparents in Ruby</title>
	<atom:link href="http://avdi.org/devblog/2010/02/25/calling-grandparents-in-ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://avdi.org/devblog/2010/02/25/calling-grandparents-in-ruby/</link>
	<description>"...the three great virtues of a programmer: laziness, impatience, and hubris." -- Larry Wall</description>
	<lastBuildDate>Sun, 29 Aug 2010 18:46:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Avdi Grimm</title>
		<link>http://avdi.org/devblog/2010/02/25/calling-grandparents-in-ruby/comment-page-1/#comment-1000</link>
		<dc:creator>Avdi Grimm</dc:creator>
		<pubDate>Fri, 26 Feb 2010 00:52:55 +0000</pubDate>
		<guid isPermaLink="false">http://avdi.org/devblog/?p=386#comment-1000</guid>
		<description>I don&#039;t think it&#039;s any more a hack than e.g. any code that uses #send to call a method. Verbose and non-obvious, maybe, but I think it&#039;s using language features for their intended purpose.</description>
		<content:encoded><![CDATA[<p>I don&#39;t think it&#39;s any more a hack than e.g. any code that uses #send to call a method. Verbose and non-obvious, maybe, but I think it&#39;s using language features for their intended purpose.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dkubb</title>
		<link>http://avdi.org/devblog/2010/02/25/calling-grandparents-in-ruby/comment-page-1/#comment-999</link>
		<dc:creator>dkubb</dc:creator>
		<pubDate>Fri, 26 Feb 2010 00:37:50 +0000</pubDate>
		<guid isPermaLink="false">http://avdi.org/devblog/?p=386#comment-999</guid>
		<description>I did not know this. I can think of a few (rare) cases where I did want access to the grant parent method so I aliased it in the parent class prior to defining the same named method in the parent.  This always felt like a bit of a hack to me, and while your idea is still a hack, the intention is clearer.&lt;br&gt;&lt;br&gt;This may also be useful in cases where the parent class is in a library you don&#039;t control, and you&#039;d prefer not locally/monkey patch it.</description>
		<content:encoded><![CDATA[<p>I did not know this. I can think of a few (rare) cases where I did want access to the grant parent method so I aliased it in the parent class prior to defining the same named method in the parent.  This always felt like a bit of a hack to me, and while your idea is still a hack, the intention is clearer.</p>
<p>This may also be useful in cases where the parent class is in a library you don&#39;t control, and you&#39;d prefer not locally/monkey patch it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Avdi Grimm</title>
		<link>http://avdi.org/devblog/2010/02/25/calling-grandparents-in-ruby/comment-page-1/#comment-1010</link>
		<dc:creator>Avdi Grimm</dc:creator>
		<pubDate>Thu, 25 Feb 2010 22:08:52 +0000</pubDate>
		<guid isPermaLink="false">http://avdi.org/devblog/?p=386#comment-1010</guid>
		<description>True. This is more of an issue for the case were you&#039;re merely calling it and not overriding it (not shown).</description>
		<content:encoded><![CDATA[<p>True. This is more of an issue for the case were you&#39;re merely calling it and not overriding it (not shown).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tommy Morgan</title>
		<link>http://avdi.org/devblog/2010/02/25/calling-grandparents-in-ruby/comment-page-1/#comment-1009</link>
		<dc:creator>Tommy Morgan</dc:creator>
		<pubDate>Thu, 25 Feb 2010 22:05:44 +0000</pubDate>
		<guid isPermaLink="false">http://avdi.org/devblog/?p=386#comment-1009</guid>
		<description>If you&#039;re overriding #foo in Child anyway, then you&#039;re already preventing that.</description>
		<content:encoded><![CDATA[<p>If you&#39;re overriding #foo in Child anyway, then you&#39;re already preventing that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Avdi Grimm</title>
		<link>http://avdi.org/devblog/2010/02/25/calling-grandparents-in-ruby/comment-page-1/#comment-1008</link>
		<dc:creator>Avdi Grimm</dc:creator>
		<pubDate>Thu, 25 Feb 2010 22:01:10 +0000</pubDate>
		<guid isPermaLink="false">http://avdi.org/devblog/?p=386#comment-1008</guid>
		<description>The problem here is that Interloper itself might use its own #foo method in other (desirable) Interloper methods.</description>
		<content:encoded><![CDATA[<p>The problem here is that Interloper itself might use its own #foo method in other (desirable) Interloper methods.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tommy Morgan</title>
		<link>http://avdi.org/devblog/2010/02/25/calling-grandparents-in-ruby/comment-page-1/#comment-1005</link>
		<dc:creator>Tommy Morgan</dc:creator>
		<pubDate>Thu, 25 Feb 2010 21:51:47 +0000</pubDate>
		<guid isPermaLink="false">http://avdi.org/devblog/?p=386#comment-1005</guid>
		<description>Now *that* is a more interesting and less scary use case. :)</description>
		<content:encoded><![CDATA[<p>Now *that* is a more interesting and less scary use case. <img src='http://avdi.org/devblog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tommy Morgan</title>
		<link>http://avdi.org/devblog/2010/02/25/calling-grandparents-in-ruby/comment-page-1/#comment-1007</link>
		<dc:creator>Tommy Morgan</dc:creator>
		<pubDate>Thu, 25 Feb 2010 21:43:35 +0000</pubDate>
		<guid isPermaLink="false">http://avdi.org/devblog/?p=386#comment-1007</guid>
		<description>It seems that allowing an unrelated module to override methods that just happen to be named the same is prone to breaking things as well, so I think by the time you&#039;re doing that you have to accept that it&#039;s going to be a bit tricky for any future maintainers to figure out what&#039;s going on. But you&#039;re right, on reflection, the alias method is unnecessarily fragile.&lt;br&gt;Perhaps it would be best then, if we&#039;re not using Interloper#foo at all? That&#039;s what bothers me about this anyway, so perhaps this would be a better solution:&lt;br&gt;&lt;a href=&quot;http://gist.github.com/314707&quot; rel=&quot;nofollow&quot;&gt;http://gist.github.com/314707&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>It seems that allowing an unrelated module to override methods that just happen to be named the same is prone to breaking things as well, so I think by the time you&#39;re doing that you have to accept that it&#39;s going to be a bit tricky for any future maintainers to figure out what&#39;s going on. But you&#39;re right, on reflection, the alias method is unnecessarily fragile.<br />Perhaps it would be best then, if we&#39;re not using Interloper#foo at all? That&#39;s what bothers me about this anyway, so perhaps this would be a better solution:<br /><a href="http://gist.github.com/314707" rel="nofollow">http://gist.github.com/314707</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Avdi Grimm</title>
		<link>http://avdi.org/devblog/2010/02/25/calling-grandparents-in-ruby/comment-page-1/#comment-1004</link>
		<dc:creator>Avdi Grimm</dc:creator>
		<pubDate>Thu, 25 Feb 2010 21:31:39 +0000</pubDate>
		<guid isPermaLink="false">http://avdi.org/devblog/?p=386#comment-1004</guid>
		<description>...not to mention that it&#039;s not usable if you&#039;re trying to define a method in a module. For instance, the case where you&#039;re writing a module which uses built-in Object methods like #send or #hash and needs to make sure the calls don&#039;t get diverted to some other intervening definition of #send or #hash, no matter where it is included.</description>
		<content:encoded><![CDATA[<p>&#8230;not to mention that it&#39;s not usable if you&#39;re trying to define a method in a module. For instance, the case where you&#39;re writing a module which uses built-in Object methods like #send or #hash and needs to make sure the calls don&#39;t get diverted to some other intervening definition of #send or #hash, no matter where it is included.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Avdi Grimm</title>
		<link>http://avdi.org/devblog/2010/02/25/calling-grandparents-in-ruby/comment-page-1/#comment-1006</link>
		<dc:creator>Avdi Grimm</dc:creator>
		<pubDate>Thu, 25 Feb 2010 21:26:28 +0000</pubDate>
		<guid isPermaLink="false">http://avdi.org/devblog/?p=386#comment-1006</guid>
		<description>I personally find that solution less elegant, and I don&#039;t like the fact that simply moving things around in the class definition could break it. It&#039;s fragile in ways that could be very nonobvious to a future maintainer. Using method binding is unambiguous as to which version of the method you want.&lt;br&gt;&lt;br&gt;YMMV, of course.</description>
		<content:encoded><![CDATA[<p>I personally find that solution less elegant, and I don&#39;t like the fact that simply moving things around in the class definition could break it. It&#39;s fragile in ways that could be very nonobvious to a future maintainer. Using method binding is unambiguous as to which version of the method you want.</p>
<p>YMMV, of course.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tommy Morgan</title>
		<link>http://avdi.org/devblog/2010/02/25/calling-grandparents-in-ruby/comment-page-1/#comment-1003</link>
		<dc:creator>Tommy Morgan</dc:creator>
		<pubDate>Thu, 25 Feb 2010 21:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://avdi.org/devblog/?p=386#comment-1003</guid>
		<description>Wouldn&#039;t it be better to alias the parent method before including the module in that case? Or is there a circumstance I&#039;m missing here?&lt;br&gt;&lt;a href=&quot;http://gist.github.com/314681&quot; rel=&quot;nofollow&quot;&gt;http://gist.github.com/314681&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Wouldn&#39;t it be better to alias the parent method before including the module in that case? Or is there a circumstance I&#39;m missing here?<br /><a href="http://gist.github.com/314681" rel="nofollow">http://gist.github.com/314681</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
