<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-12616776.post114947778315329094..comments</id><updated>2009-03-30T04:44:18.625+10:00</updated><title type='text'>Comments on nosewheelie: Ruby early return considered harmful (for idiots l...</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://nosewheelie.blogspot.com/feeds/114947778315329094/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12616776/114947778315329094/comments/default'/><link rel='alternate' type='text/html' href='http://nosewheelie.blogspot.com/2006/06/ruby-early-return-considered-harmful.html'/><author><name>Tom Adams</name><uri>http://www.blogger.com/profile/16126053163040522576</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-12616776.post-6850765531204248469</id><published>2009-03-30T04:44:00.000+10:00</published><updated>2009-03-30T04:44:00.000+10:00</updated><title type='text'>Regular expression is really wonderful to parsing ...</title><content type='html'>Regular expression is really wonderful to parsing HTML or matching pattern. I use this a lot when i code. Actually when I learn any new langauge, first of all I first try whether it supports regex or not. I feel ezee when I found that.&lt;BR/&gt;&lt;BR/&gt;&lt;A HREF="http://icfun.blogspot.com/2008/04/ruby-regular-expression-handling.html" REL="nofollow"&gt;http://icfun.blogspot.com/2008/04/ruby-regular-expression-handling.html&lt;/A&gt;&lt;BR/&gt;&lt;BR/&gt;Here is about ruby regex. This was posted by me when I first learn ruby regex. So it will be helpfull for New coders.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12616776/114947778315329094/comments/default/6850765531204248469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12616776/114947778315329094/comments/default/6850765531204248469'/><link rel='alternate' type='text/html' href='http://nosewheelie.blogspot.com/2006/06/ruby-early-return-considered-harmful.html?showComment=1238352240000#c6850765531204248469' title=''/><author><name>Wolf</name><uri>http://www.blogger.com/profile/17577123618506519393</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://nosewheelie.blogspot.com/2006/06/ruby-early-return-considered-harmful.html' ref='tag:blogger.com,1999:blog-12616776.post-114947778315329094' source='http://www.blogger.com/feeds/12616776/posts/default/114947778315329094' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-12616776.post-2949051395952811314</id><published>2009-03-30T04:34:00.000+10:00</published><updated>2009-03-30T04:34:00.000+10:00</updated><title type='text'>Regular expression is really wonderful to parsing ...</title><content type='html'>Regular expression is really wonderful to parsing HTML or matching pattern. I use this a lot when i code. Actually when I learn any new langauge, first of all I first try whether it supports regex or not. I feel ezee when I found that.&lt;BR/&gt;&lt;BR/&gt;&lt;A HREF="http://icfun.blogspot.com/2008/04/ruby-regular-expression-handling.html" REL="nofollow"&gt;http://icfun.blogspot.com/2008/04/ruby-regular-expression-handling.html&lt;/A&gt;&lt;BR/&gt;&lt;BR/&gt;Here is about ruby regex. This was posted by me when I first learn ruby regex. So it will be helpfull for New coders.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12616776/114947778315329094/comments/default/2949051395952811314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12616776/114947778315329094/comments/default/2949051395952811314'/><link rel='alternate' type='text/html' href='http://nosewheelie.blogspot.com/2006/06/ruby-early-return-considered-harmful.html?showComment=1238351640000#c2949051395952811314' title=''/><author><name>Wolf</name><uri>http://www.blogger.com/profile/17577123618506519393</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://nosewheelie.blogspot.com/2006/06/ruby-early-return-considered-harmful.html' ref='tag:blogger.com,1999:blog-12616776.post-114947778315329094' source='http://www.blogger.com/feeds/12616776/posts/default/114947778315329094' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-12616776.post-114975622450417132</id><published>2006-06-08T18:43:00.000+10:00</published><updated>2006-06-08T18:43:00.000+10:00</updated><title type='text'>You probably know this by now:The =~ operator retu...</title><content type='html'>You probably know this by now:&lt;BR/&gt;&lt;BR/&gt;The =~ operator returns the character position in the string of the start of the match (which evaluates to true in a boolean test), or nil if no match was found (which evaluates to false). &lt;BR/&gt;&lt;BR/&gt;See &lt;A HREF="http://www.regular-expressions.info/ruby.html" REL="nofollow"&gt;here&lt;/A&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12616776/114947778315329094/comments/default/114975622450417132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12616776/114947778315329094/comments/default/114975622450417132'/><link rel='alternate' type='text/html' href='http://nosewheelie.blogspot.com/2006/06/ruby-early-return-considered-harmful.html?showComment=1149756180000#c114975622450417132' title=''/><author><name>bw</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://nosewheelie.blogspot.com/2006/06/ruby-early-return-considered-harmful.html' ref='tag:blogger.com,1999:blog-12616776.post-114947778315329094' source='http://www.blogger.com/feeds/12616776/posts/default/114947778315329094' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-12616776.post-114967961828618973</id><published>2006-06-07T21:26:00.000+10:00</published><updated>2006-06-07T21:26:00.000+10:00</updated><title type='text'>I was playing around with it basically. I went fro...</title><content type='html'>I was playing around with it basically. I went from the simplest (what you suggested), to the long hand form after hitting trouble. I'm still not convinced that the regex operator is behaving correctly (where correctly means my interpretation of it :), so I haven't dropped the true/false bits yet. The operator does more that just return true or false, it returns nil (i.e. null) if it doesn't find a match, or the index of the match if it does find it. I'm not sure how this behaves when used in an if.&lt;BR/&gt;&lt;BR/&gt;Luckily I have test-driven the code, so I just changed it and it still works! Cheers.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12616776/114947778315329094/comments/default/114967961828618973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12616776/114947778315329094/comments/default/114967961828618973'/><link rel='alternate' type='text/html' href='http://nosewheelie.blogspot.com/2006/06/ruby-early-return-considered-harmful.html?showComment=1149679560000#c114967961828618973' title=''/><author><name>Tom Adams</name><uri>http://www.blogger.com/profile/13733408421582323206</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://nosewheelie.blogspot.com/2006/06/ruby-early-return-considered-harmful.html' ref='tag:blogger.com,1999:blog-12616776.post-114947778315329094' source='http://www.blogger.com/feeds/12616776/posts/default/114947778315329094' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-12616776.post-114952403269073679</id><published>2006-06-06T02:13:00.000+10:00</published><updated>2006-06-06T02:13:00.000+10:00</updated><title type='text'>OK, I know nothing of Ruby, but I'm wondering why ...</title><content type='html'>OK, I know nothing of Ruby, but I'm wondering why you chose to use the &lt;EM&gt;if&lt;/EM&gt; statement at all.  What's wrong with:&lt;BR/&gt;&lt;EM&gt;def Uuid.isUuid(fragment)&lt;BR/&gt; return fragment =~ REGEX&lt;BR/&gt;end&lt;/EM&gt;&lt;BR/&gt;&lt;BR/&gt;For that matter, since it seems to use the last evaluated value as the return value, how about dropping the &lt;EM&gt;return&lt;/EM&gt;?&lt;BR/&gt;&lt;EM&gt;def Uuid.isUuid(fragment)&lt;BR/&gt; fragment =~ REGEX&lt;BR/&gt;end&lt;/EM&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12616776/114947778315329094/comments/default/114952403269073679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12616776/114947778315329094/comments/default/114952403269073679'/><link rel='alternate' type='text/html' href='http://nosewheelie.blogspot.com/2006/06/ruby-early-return-considered-harmful.html?showComment=1149523980000#c114952403269073679' title=''/><author><name>Quoll</name><uri>http://www.blogger.com/profile/03653112583629043593</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://nosewheelie.blogspot.com/2006/06/ruby-early-return-considered-harmful.html' ref='tag:blogger.com,1999:blog-12616776.post-114947778315329094' source='http://www.blogger.com/feeds/12616776/posts/default/114947778315329094' type='text/html'/></entry></feed>