<?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"
	>
<channel>
	<title>Comments on: A better &#8220;try()&#8221; for Ruby, why not do the Groovy way?</title>
	<atom:link href="http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/</link>
	<description>Just a little about development! Think before you write!</description>
	<pubDate>Sun, 07 Sep 2008 19:31:40 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Urubatan</title>
		<link>http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-2405</link>
		<dc:creator>Urubatan</dc:creator>
		<pubDate>Mon, 19 May 2008 01:49:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-2405</guid>
		<description>Arno, thinking about the other comments in this thread, I change my position, and I agree that playing with method_missing is not a good solution ...
Even because Rails applications, and Ruby applications in general do not have a very complex object hierarchy.
By complex I mean, usually you do not go very deep in the object model to show an information.
I think this post was inspired by the java programmer inside my head :D</description>
		<content:encoded><![CDATA[<p>Arno, thinking about the other comments in this thread, I change my position, and I agree that playing with method_missing is not a good solution &#8230;<br />
Even because Rails applications, and Ruby applications in general do not have a very complex object hierarchy.<br />
By complex I mean, usually you do not go very deep in the object model to show an information.<br />
I think this post was inspired by the java programmer inside my head <img src='http://www.urubatan.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arno Nyhm</title>
		<link>http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-2404</link>
		<dc:creator>Arno Nyhm</dc:creator>
		<pubDate>Sun, 18 May 2008 18:22:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-2404</guid>
		<description>whats about a ? in as the first letter?


puts @person.?company.?name</description>
		<content:encoded><![CDATA[<p>whats about a ? in as the first letter?</p>
<p>puts @person.?company.?name</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rajesh Duggal</title>
		<link>http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-2135</link>
		<dc:creator>Rajesh Duggal</dc:creator>
		<pubDate>Wed, 30 Apr 2008 21:22:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-2135</guid>
		<description>http://andand.rubyforge.org/</description>
		<content:encoded><![CDATA[<p><a href="http://andand.rubyforge.org/" rel="nofollow" onclick="javascript:urchinTracker ('/outbound/comment/andand.rubyforge.org');">http://andand.rubyforge.org/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: trapdoor1 &#187; Object.too_clever_by_half? rescue nil</title>
		<link>http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-1930</link>
		<dc:creator>trapdoor1 &#187; Object.too_clever_by_half? rescue nil</dc:creator>
		<pubDate>Sat, 05 Apr 2008 13:08:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-1930</guid>
		<description>[...] Monkey-patching proposals have abounded in the Ruby community recently - including, but not limited to Object#andand, Object#_? and SafeNil and Object#method_. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Monkey-patching proposals have abounded in the Ruby community recently - including, but not limited to Object#andand, Object#_? and SafeNil and Object#method_. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juan Maiz Lulkin Flores da Cunha</title>
		<link>http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-1909</link>
		<dc:creator>Juan Maiz Lulkin Flores da Cunha</dc:creator>
		<pubDate>Thu, 03 Apr 2008 20:54:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-1909</guid>
		<description>Me parece uma cópia do operador ? do Io ...

http://www.iolanguage.com/scm/git/checkout/Io/docs/IoGuide.html</description>
		<content:encoded><![CDATA[<p>Me parece uma cópia do operador ? do Io &#8230;</p>
<p><a href="http://www.iolanguage.com/scm/git/checkout/Io/docs/IoGuide.html" rel="nofollow" onclick="javascript:urchinTracker ('/outbound/comment/www.iolanguage.com');">http://www.iolanguage.com/scm/git/checkout/Io/docs/IoGuide.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 프로그래밍 루비 &#187; Blog Archive &#187; 짧은 코드 한 줄이 주는 영감 - try() 놀이</title>
		<link>http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-1547</link>
		<dc:creator>프로그래밍 루비 &#187; Blog Archive &#187; 짧은 코드 한 줄이 주는 영감 - try() 놀이</dc:creator>
		<pubDate>Fri, 14 Mar 2008 08:45:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-1547</guid>
		<description>[...] 루비에서도 이 문법을 차용해오자는 의견도 있다. 구현은 method_missing을 이용해 처리해줄 수 있을 것 같다. 재미있는 [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] 루비에서도 이 문법을 차용해오자는 의견도 있다. 구현은 method_missing을 이용해 처리해줄 수 있을 것 같다. 재미있는 [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Urubatan</title>
		<link>http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-1501</link>
		<dc:creator>Urubatan</dc:creator>
		<pubDate>Wed, 12 Mar 2008 15:06:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-1501</guid>
		<description>I think the captcha is already working :D
but if SK2 is working you'll not see it again :D
Matt, I agree that the "?" termination would be more clear, but there is already a convention in ruby programming saying that methods terminated in "?" return a boolean value ...

Renan, I use the WP-Syntax plugin

Arya, try_method_name is a good approach too, and it looks like calling a method (different of try(:method_name) ), the "_" having no meaning is a matter of convention, line the "?" at the end of boolean methods :D

Mark, I agree this is ugly, but I think try(:method_name) is uglier because it is not clear that you are calling a method (IMHO) :D</description>
		<content:encoded><![CDATA[<p>I think the captcha is already working <img src='http://www.urubatan.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
but if SK2 is working you&#8217;ll not see it again <img src='http://www.urubatan.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
Matt, I agree that the &#8220;?&#8221; termination would be more clear, but there is already a convention in ruby programming saying that methods terminated in &#8220;?&#8221; return a boolean value &#8230;</p>
<p>Renan, I use the WP-Syntax plugin</p>
<p>Arya, try_method_name is a good approach too, and it looks like calling a method (different of try(:method_name) ), the &#8220;_&#8221; having no meaning is a matter of convention, line the &#8220;?&#8221; at the end of boolean methods <img src='http://www.urubatan.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Mark, I agree this is ugly, but I think try(:method_name) is uglier because it is not clear that you are calling a method (IMHO) <img src='http://www.urubatan.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rajesh Duggal</title>
		<link>http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-1478</link>
		<dc:creator>Rajesh Duggal</dc:creator>
		<pubDate>Tue, 11 Mar 2008 18:37:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-1478</guid>
		<description>I've been doing...
@person &#38;&#38; @person.name

It's a little bit less typing than
@person.name unless @person.nil?

It gets really useful when you want to go deeper into an object..

e.g. id = @person &#38;&#38; @person.friend &#38;&#38;  @person.friend.youngest &#38;&#38; @person.friend.youngest.user &#38;&#38; @person.friend.youngest.user.id

( Careful now.. http://en.wikipedia.org/wiki/Law_of_Demeter )

Cheers,
Rajesh Duggal</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been doing&#8230;<br />
@person &amp;&amp; @person.name</p>
<p>It&#8217;s a little bit less typing than<br />
@person.name unless @person.nil?</p>
<p>It gets really useful when you want to go deeper into an object..</p>
<p>e.g. id = @person &amp;&amp; @person.friend &amp;&amp;  @person.friend.youngest &amp;&amp; @person.friend.youngest.user &amp;&amp; @person.friend.youngest.user.id</p>
<p>( Careful now.. <a href="http://en.wikipedia.org/wiki/Law_of_Demeter" rel="nofollow" onclick="javascript:urchinTracker ('/outbound/comment/en.wikipedia.org');">http://en.wikipedia.org/wiki/Law_of_Demeter</a> )</p>
<p>Cheers,<br />
Rajesh Duggal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Todd</title>
		<link>http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-1432</link>
		<dc:creator>Matt Todd</dc:creator>
		<pubDate>Sun, 09 Mar 2008 05:47:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-1432</guid>
		<description>By the by, your captcha image isn't showing up... :(</description>
		<content:encoded><![CDATA[<p>By the by, your captcha image isn&#8217;t showing up&#8230; <img src='http://www.urubatan.info/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Todd</title>
		<link>http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-1431</link>
		<dc:creator>Matt Todd</dc:creator>
		<pubDate>Sun, 09 Mar 2008 05:45:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.urubatan.info/2008/03/a-better-try-for-ruby-why-not-do-the-groovy-way/#comment-1431</guid>
		<description>Could just see if methodname[0..-2] exists, effectively allowing:

person?.name

The test could be written:

respond_to? :"#{methodname[0..-2]}" if methodname.split('').last == '?'

Something like that... Come now, we can use the '?' in our method names! Makes much more sense than '_'.</description>
		<content:encoded><![CDATA[<p>Could just see if methodname[0..-2] exists, effectively allowing:</p>
<p>person?.name</p>
<p>The test could be written:</p>
<p>respond_to? :&#8221;#{methodname[0..-2]}&#8221; if methodname.split(&#8221;).last == &#8216;?&#8217;</p>
<p>Something like that&#8230; Come now, we can use the &#8216;?&#8217; in our method names! Makes much more sense than &#8216;_&#8217;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
