<?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: Errorhandling Ruby vs. Java</title>
	<atom:link href="http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/feed/" rel="self" type="application/rss+xml" />
	<link>http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/</link>
	<description>ruby, java and the rest</description>
	<lastBuildDate>Mon, 05 Dec 2011 11:57:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: lenciel &#187; 博客文章 &#187; 昨日搜刮</title>
		<link>http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/comment-page-1/#comment-49818</link>
		<dc:creator>lenciel &#187; 博客文章 &#187; 昨日搜刮</dc:creator>
		<pubDate>Mon, 19 Mar 2007 15:17:17 +0000</pubDate>
		<guid isPermaLink="false">http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/#comment-49818</guid>
		<description>[...] Errorhandling Ruby vs. Java # [...]</description>
		<content:encoded><![CDATA[<p>[...] Errorhandling Ruby vs. Java # [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank Spychalski</title>
		<link>http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/comment-page-1/#comment-2917</link>
		<dc:creator>Frank Spychalski</dc:creator>
		<pubDate>Mon, 12 Jun 2006 08:26:22 +0000</pubDate>
		<guid isPermaLink="false">http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/#comment-2917</guid>
		<description>Neutronica, I want both :-)&lt;!-- X-spaminator-strike: whitelist, -3 --&gt;&lt;!-- X-spaminator-passed: IP check --&gt;&lt;!-- X-spaminator-passed: email check --&gt;&lt;!-- X-spaminator-passed: author url --&gt;&lt;!-- X-spaminator-passed: comment body --&gt;&lt;!-- X-spaminator-strike: url dashes, 3 --&gt;</description>
		<content:encoded><![CDATA[<p>Neutronica, I want both <img src='http://amazing-development.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> <!-- X-spaminator-strike: whitelist, -3 --><!-- X-spaminator-passed: IP check --><!-- X-spaminator-passed: email check --><!-- X-spaminator-passed: author url --><!-- X-spaminator-passed: comment body --><!-- X-spaminator-strike: url dashes, 3 --></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neutronica</title>
		<link>http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/comment-page-1/#comment-2916</link>
		<dc:creator>Neutronica</dc:creator>
		<pubDate>Mon, 12 Jun 2006 02:12:17 +0000</pubDate>
		<guid isPermaLink="false">http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/#comment-2916</guid>
		<description>Eh. It got chopped. Event w/ the yicky chunk above you should be able to figure out what I&#039;m about: suffice to say, much nicer in Ruby, and this might be a usecase for AOP.&lt;!-- X-spaminator-passed: IP check --&gt;&lt;!-- X-spaminator-passed: email check --&gt;&lt;!-- X-spaminator-passed: author check --&gt;&lt;!-- X-spaminator-strike: empty field - author url, 1 --&gt;&lt;!-- X-spaminator-passed: author url --&gt;&lt;!-- X-spaminator-passed: comment body --&gt;</description>
		<content:encoded><![CDATA[<p>Eh. It got chopped. Event w/ the yicky chunk above you should be able to figure out what I&#8217;m about: suffice to say, much nicer in Ruby, and this might be a usecase for AOP.<!-- X-spaminator-passed: IP check --><!-- X-spaminator-passed: email check --><!-- X-spaminator-passed: author check --><!-- X-spaminator-strike: empty field - author url, 1 --><!-- X-spaminator-passed: author url --><!-- X-spaminator-passed: comment body --></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neutronica</title>
		<link>http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/comment-page-1/#comment-2915</link>
		<dc:creator>Neutronica</dc:creator>
		<pubDate>Mon, 12 Jun 2006 02:11:03 +0000</pubDate>
		<guid isPermaLink="false">http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/#comment-2915</guid>
		<description>Actually, I don&#039;t think you want the above, either: you want a retry keyword...

Without thinking about it much, the best I could come up with is something like this:

    public static Object block(final IRetry block_,
                               final Class[] catch_,
                               final int tries_)
                         throws RuntimeException {
        Exception finalException = null;
        for (int i = 0; i &lt;!-- X-spaminator-passed: email check --&gt;&lt;!-- X-spaminator-passed: author check --&gt;&lt;!-- X-spaminator-strike: empty field - author url, 1 --&gt;&lt;!-- X-spaminator-passed: author url --&gt;&lt;!-- X-spaminator-passed: comment body --&gt;&lt;!-- X-spaminator-strike: url dashes, 2 --&gt;</description>
		<content:encoded><![CDATA[<p>Actually, I don&#8217;t think you want the above, either: you want a retry keyword&#8230;</p>
<p>Without thinking about it much, the best I could come up with is something like this:</p>
<p>    public static Object block(final IRetry block_,<br />
                               final Class[] catch_,<br />
                               final int tries_)<br />
                         throws RuntimeException {<br />
        Exception finalException = null;<br />
        for (int i = 0; i <!-- X-spaminator-passed: email check --><!-- X-spaminator-passed: author check --><!-- X-spaminator-strike: empty field - author url, 1 --><!-- X-spaminator-passed: author url --><!-- X-spaminator-passed: comment body --><!-- X-spaminator-strike: url dashes, 2 --></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank Spychalski</title>
		<link>http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/comment-page-1/#comment-598</link>
		<dc:creator>Frank Spychalski</dc:creator>
		<pubDate>Tue, 04 Apr 2006 07:16:02 +0000</pubDate>
		<guid isPermaLink="false">http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/#comment-598</guid>
		<description>Again, I should have been more specific :-) I usually have to do more than just print out the stacktrace. This errorhandling is sometimes the same for different Exceptions. This leads to solutions like the one below, which I don&#039;t consider very elegant, compared to the Ruby solution:

try {
foo();
} catch(java.sql.SQLException e) {
handleEx(sqle);
} catch(java.util.concurrent.TimeoutException e) {
handleEx(e);
}

private void handleEx(Exception e) {
  ...
}

I would like to see:

try {
  foo();
} catch(java.sql.SQLException, java.util.concurrent.TimeoutException : Exception e) {
  ...
}

I admit, this is just syntactic sugar but I like sugar :-)</description>
		<content:encoded><![CDATA[<p>Again, I should have been more specific <img src='http://amazing-development.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  I usually have to do more than just print out the stacktrace. This errorhandling is sometimes the same for different Exceptions. This leads to solutions like the one below, which I don&#8217;t consider very elegant, compared to the Ruby solution:</p>
<p>try {<br />
foo();<br />
} catch(java.sql.SQLException e) {<br />
handleEx(sqle);<br />
} catch(java.util.concurrent.TimeoutException e) {<br />
handleEx(e);<br />
}</p>
<p>private void handleEx(Exception e) {<br />
  &#8230;<br />
}</p>
<p>I would like to see:</p>
<p>try {<br />
  foo();<br />
} catch(java.sql.SQLException, java.util.concurrent.TimeoutException : Exception e) {<br />
  &#8230;<br />
}</p>
<p>I admit, this is just syntactic sugar but I like sugar <img src='http://amazing-development.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Fisher</title>
		<link>http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/comment-page-1/#comment-597</link>
		<dc:creator>Robert Fisher</dc:creator>
		<pubDate>Mon, 03 Apr 2006 17:51:06 +0000</pubDate>
		<guid isPermaLink="false">http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/#comment-597</guid>
		<description>&quot;I would very much like to see a elegant solution which catches only java.sql.SQLException and java.util.concurrent.TimeoutException&quot;

try {
  foo();
} catch(java.sql.SQLException e) {
  sqle.printStackTrace();
} catch(java.util.concurrent.TimeoutException e) {
  e.printStackTrace();
}&lt;!-- X-spaminator-passed: IP check --&gt;&lt;!-- X-spaminator-passed: email check --&gt;&lt;!-- X-spaminator-passed: author check --&gt;&lt;!-- X-spaminator-passed: author url --&gt;&lt;!-- X-spaminator-passed: comment body --&gt;</description>
		<content:encoded><![CDATA[<p>&#8220;I would very much like to see a elegant solution which catches only java.sql.SQLException and java.util.concurrent.TimeoutException&#8221;</p>
<p>try {<br />
  foo();<br />
} catch(java.sql.SQLException e) {<br />
  sqle.printStackTrace();<br />
} catch(java.util.concurrent.TimeoutException e) {<br />
  e.printStackTrace();<br />
}<!-- X-spaminator-passed: IP check --><!-- X-spaminator-passed: email check --><!-- X-spaminator-passed: author check --><!-- X-spaminator-passed: author url --><!-- X-spaminator-passed: comment body --></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/comment-page-1/#comment-595</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Sat, 01 Apr 2006 20:55:09 +0000</pubDate>
		<guid isPermaLink="false">http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/#comment-595</guid>
		<description>This article is written very poorly.  You need to supply an example that compares and contrasts java code vs. the ruby code.  Maybe code the same solution in both languages. As far as your comment &quot; there is no elegant way of catching 2 or more exceptions without catching Exception or Throwable&quot; is concerned, you are wrong. You need to look into OOP and polymorphism.  Also, look at some design pattern books, then maybe you can start posting comments why you think ruby is so much better than java.  ps, your site breaks in the Opera browser.&lt;!-- X-spaminator-passed: IP check --&gt;&lt;!-- X-spaminator-passed: email check --&gt;&lt;!-- X-spaminator-passed: author check --&gt;&lt;!-- X-spaminator-strike: empty field - author url, 1 --&gt;&lt;!-- X-spaminator-passed: author url --&gt;&lt;!-- X-spaminator-passed: comment body --&gt;</description>
		<content:encoded><![CDATA[<p>This article is written very poorly.  You need to supply an example that compares and contrasts java code vs. the ruby code.  Maybe code the same solution in both languages. As far as your comment &#8221; there is no elegant way of catching 2 or more exceptions without catching Exception or Throwable&#8221; is concerned, you are wrong. You need to look into OOP and polymorphism.  Also, look at some design pattern books, then maybe you can start posting comments why you think ruby is so much better than java.  ps, your site breaks in the Opera browser.<!-- X-spaminator-passed: IP check --><!-- X-spaminator-passed: email check --><!-- X-spaminator-passed: author check --><!-- X-spaminator-strike: empty field - author url, 1 --><!-- X-spaminator-passed: author url --><!-- X-spaminator-passed: comment body --></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank Spychalski</title>
		<link>http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/comment-page-1/#comment-593</link>
		<dc:creator>Frank Spychalski</dc:creator>
		<pubDate>Sat, 01 Apr 2006 19:25:59 +0000</pubDate>
		<guid isPermaLink="false">http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/#comment-593</guid>
		<description>notany, Peter: thanks for the pointers&lt;!-- X-spaminator-strike: whitelist, -3 --&gt;&lt;!-- X-spaminator-passed: IP check --&gt;&lt;!-- X-spaminator-passed: email check --&gt;&lt;!-- X-spaminator-passed: author url --&gt;&lt;!-- X-spaminator-passed: comment body --&gt;&lt;!-- X-spaminator-strike: url dashes, 1 --&gt;</description>
		<content:encoded><![CDATA[<p>notany, Peter: thanks for the pointers<!-- X-spaminator-strike: whitelist, -3 --><!-- X-spaminator-passed: IP check --><!-- X-spaminator-passed: email check --><!-- X-spaminator-passed: author url --><!-- X-spaminator-passed: comment body --><!-- X-spaminator-strike: url dashes, 1 --></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Cooper</title>
		<link>http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/comment-page-1/#comment-592</link>
		<dc:creator>Peter Cooper</dc:creator>
		<pubDate>Sat, 01 Apr 2006 18:42:27 +0000</pubDate>
		<guid isPermaLink="false">http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/#comment-592</guid>
		<description>Two queue ideas for Ruby.. Spread is a good messaging system that&#039;s been around years and there&#039;s a good Ruby client library. Just been playing with it, very nice. Alternatively, BerkeleyDB has a Queue mechanism. Both of these are mature technologies.&lt;!-- X-spaminator-passed: IP check --&gt;&lt;!-- X-spaminator-passed: email check --&gt;&lt;!-- X-spaminator-passed: author check --&gt;&lt;!-- X-spaminator-passed: author url --&gt;&lt;!-- X-spaminator-passed: comment body --&gt;</description>
		<content:encoded><![CDATA[<p>Two queue ideas for Ruby.. Spread is a good messaging system that&#8217;s been around years and there&#8217;s a good Ruby client library. Just been playing with it, very nice. Alternatively, BerkeleyDB has a Queue mechanism. Both of these are mature technologies.<!-- X-spaminator-passed: IP check --><!-- X-spaminator-passed: email check --><!-- X-spaminator-passed: author check --><!-- X-spaminator-passed: author url --><!-- X-spaminator-passed: comment body --></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: notany</title>
		<link>http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/comment-page-1/#comment-591</link>
		<dc:creator>notany</dc:creator>
		<pubDate>Sat, 01 Apr 2006 15:21:35 +0000</pubDate>
		<guid isPermaLink="false">http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/#comment-591</guid>
		<description>Everyone who is intrested digging deeper into Rubys error handling and it&#039;s pros and cons and philosophical motivations behind it, should read the following paper (now online). Like many other things, Common Lisp has the most advanced condition system in existence. Ruby&#039;s is restricted version of that. 

Condition Handling in the Lisp Language Family
http://www.nhplace.com/kent/Papers/Condition-Handling-2001.html

This paper appears in Advances in Exception Handling Techniques,
edited by A. Romanovsky, C. Dony, J.L. Knudsen, and A. Tripathi.
This book, published in 2001, is part of Lecture Notes in Computer Science, Volume 2022,
published by Springer.&lt;!-- X-spaminator-passed: IP check --&gt;&lt;!-- X-spaminator-strike: excessive links, 3 --&gt;&lt;!-- X-spaminator-passed: email check --&gt;&lt;!-- X-spaminator-passed: author check --&gt;&lt;!-- X-spaminator-passed: author url --&gt;&lt;!-- X-spaminator-passed: comment body --&gt;&lt;!-- X-spaminator-strike: url dashes, 4 --&gt;</description>
		<content:encoded><![CDATA[<p>Everyone who is intrested digging deeper into Rubys error handling and it&#8217;s pros and cons and philosophical motivations behind it, should read the following paper (now online). Like many other things, Common Lisp has the most advanced condition system in existence. Ruby&#8217;s is restricted version of that. </p>
<p>Condition Handling in the Lisp Language Family<br />
<a href="http://www.nhplace.com/kent/Papers/Condition-Handling-2001.html" rel="nofollow">http://www.nhplace.com/kent/Papers/Condition-Handling-2001.html</a></p>
<p>This paper appears in Advances in Exception Handling Techniques,<br />
edited by A. Romanovsky, C. Dony, J.L. Knudsen, and A. Tripathi.<br />
This book, published in 2001, is part of Lecture Notes in Computer Science, Volume 2022,<br />
published by Springer.<!-- X-spaminator-passed: IP check --><!-- X-spaminator-strike: excessive links, 3 --><!-- X-spaminator-passed: email check --><!-- X-spaminator-passed: author check --><!-- X-spaminator-passed: author url --><!-- X-spaminator-passed: comment body --><!-- X-spaminator-strike: url dashes, 4 --></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank Spychalski</title>
		<link>http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/comment-page-1/#comment-590</link>
		<dc:creator>Frank Spychalski</dc:creator>
		<pubDate>Sat, 01 Apr 2006 11:56:13 +0000</pubDate>
		<guid isPermaLink="false">http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/#comment-590</guid>
		<description>The queue I was refering to, was a Java JMS Queue within JBoss. For what do you need a queue and what kind of problem are you trying to solve with it? </description>
		<content:encoded><![CDATA[<p>The queue I was refering to, was a Java JMS Queue within JBoss. For what do you need a queue and what kind of problem are you trying to solve with it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mal</title>
		<link>http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/comment-page-1/#comment-589</link>
		<dc:creator>mal</dc:creator>
		<pubDate>Sat, 01 Apr 2006 10:49:29 +0000</pubDate>
		<guid isPermaLink="false">http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/#comment-589</guid>
		<description>What are you using as a Queue in Ruby? I am looking for a good message que to use with ruby. Something really robust and fast.&lt;!-- X-spaminator-passed: IP check --&gt;&lt;!-- X-spaminator-passed: email check --&gt;&lt;!-- X-spaminator-strike: short field, 1 --&gt;&lt;!-- X-spaminator-passed: author check --&gt;&lt;!-- X-spaminator-strike: empty field - author url, 1 --&gt;&lt;!-- X-spaminator-passed: author url --&gt;&lt;!-- X-spaminator-passed: comment body --&gt;</description>
		<content:encoded><![CDATA[<p>What are you using as a Queue in Ruby? I am looking for a good message que to use with ruby. Something really robust and fast.<!-- X-spaminator-passed: IP check --><!-- X-spaminator-passed: email check --><!-- X-spaminator-strike: short field, 1 --><!-- X-spaminator-passed: author check --><!-- X-spaminator-strike: empty field - author url, 1 --><!-- X-spaminator-passed: author url --><!-- X-spaminator-passed: comment body --></p>
]]></content:encoded>
	</item>
</channel>
</rss>

