<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Checked Exceptions: Failed Experiment?</title>
	<link>http://www.alittlemadness.com/2008/03/12/checked-exceptions-failed-experiment/</link>
	<description>A man needs a little madness, or else he never dares cut the rope and be free. -Nikos Kazantzakis</description>
	<pubDate>Wed, 20 Aug 2008 20:20:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: Hugo</title>
		<link>http://www.alittlemadness.com/2008/03/12/checked-exceptions-failed-experiment/#comment-59481</link>
		<author>Hugo</author>
		<pubDate>Tue, 18 Mar 2008 14:36:43 +0000</pubDate>
		<guid>http://www.alittlemadness.com/2008/03/12/checked-exceptions-failed-experiment/#comment-59481</guid>
		<description>Hi Squirrel 
about the awful stack traces due to runtime exceptions: you might like have a look at http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.UncaughtExceptionHandler.html 
and Thread.setDefaultUncaughtExceptionHandler(....)

These provide a way to handle runtime exceptions in a custom way (file logging, dialog, etc...).</description>
		<content:encoded><![CDATA[<p>Hi Squirrel<br />
about the awful stack traces due to runtime exceptions: you might like have a look at <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.UncaughtExceptionHandler.html" rel="nofollow">http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.UncaughtExceptionHandler.html</a><br />
and Thread.setDefaultUncaughtExceptionHandler(&#8230;.)</p>
<p>These provide a way to handle runtime exceptions in a custom way (file logging, dialog, etc&#8230;).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter lawrey</title>
		<link>http://www.alittlemadness.com/2008/03/12/checked-exceptions-failed-experiment/#comment-58764</link>
		<author>peter lawrey</author>
		<pubDate>Wed, 12 Mar 2008 21:59:30 +0000</pubDate>
		<guid>http://www.alittlemadness.com/2008/03/12/checked-exceptions-failed-experiment/#comment-58764</guid>
		<description>Given that methods deprecated in Java 1 are still there today do make removing checked exceptions rather unlikely.
You could have all your method "throws Exception" and ignore them completely if you want to treat them as fatal or ignored at random. 
I am not one of them. :)</description>
		<content:encoded><![CDATA[<p>Given that methods deprecated in Java 1 are still there today do make removing checked exceptions rather unlikely.<br />
You could have all your method &#8220;throws Exception&#8221; and ignore them completely if you want to treat them as fatal or ignored at random.<br />
I am not one of them. <img src='http://www.alittlemadness.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter lawrey</title>
		<link>http://www.alittlemadness.com/2008/03/12/checked-exceptions-failed-experiment/#comment-58763</link>
		<author>peter lawrey</author>
		<pubDate>Wed, 12 Mar 2008 21:55:25 +0000</pubDate>
		<guid>http://www.alittlemadness.com/2008/03/12/checked-exceptions-failed-experiment/#comment-58763</guid>
		<description>Checked Exception have there place. When designing an API I rause checked exceptions when I expect the caller to handle them.  I err on the side of not creating too many variations of checked exceptions so the caller can catch them fairly genericly but still hold enough information to do something about it.
Generally, I would say the callee should try to handle recoverable exceptions however there is often a human involved and notifying them that an operation has failed is important.
Developers typically start by just trying to get something which works, getting something which robustly handles error conditions (assuming you know all possible error conditions) is much harder.
For those who like rapid prototyping I can understand that checked exceptions are annoying, in which case something like groovy or ruby might be a better choice. (I don't know how their exceptions work...)</description>
		<content:encoded><![CDATA[<p>Checked Exception have there place. When designing an API I rause checked exceptions when I expect the caller to handle them.  I err on the side of not creating too many variations of checked exceptions so the caller can catch them fairly genericly but still hold enough information to do something about it.<br />
Generally, I would say the callee should try to handle recoverable exceptions however there is often a human involved and notifying them that an operation has failed is important.<br />
Developers typically start by just trying to get something which works, getting something which robustly handles error conditions (assuming you know all possible error conditions) is much harder.<br />
For those who like rapid prototyping I can understand that checked exceptions are annoying, in which case something like groovy or ruby might be a better choice. (I don&#8217;t know how their exceptions work&#8230;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Squirrel Sewer</title>
		<link>http://www.alittlemadness.com/2008/03/12/checked-exceptions-failed-experiment/#comment-58565</link>
		<author>Squirrel Sewer</author>
		<pubDate>Tue, 11 Mar 2008 18:43:02 +0000</pubDate>
		<guid>http://www.alittlemadness.com/2008/03/12/checked-exceptions-failed-experiment/#comment-58565</guid>
		<description>I think you are fighting the good fight: good error handling is the cornerstone of a maintainable system.  I don't agree w/ the Effective Java quote, tho.

"Use checked exceptions for recoverable conditions..." 
What percentage of the Exceptions in your code relate to a recoverable conditions?  I maintain a large webapp, and my personal answer is "very few, maybe none".  I want to handle errors, I really do.

"and runtime exceptions for programming errors"
Runtime Exceptions have a very big problem - they produce awful stack traces.  Checked exceptions, used properly, get caught and wrapped at every level of the call stack, and end up providing all kinds of juicy data when you are reading over the stack.  Why should programming errors have awful stack traces?  They're way more common than recoverable problems, and just as import to diagnose.

I don't have any great solutions, just wanted to point out I rarely see opportunities for meaningful recovery, and that I hate stack traces caused by RuntimeExceptions slipping up to the top of the call stack w/ no chaining.</description>
		<content:encoded><![CDATA[<p>I think you are fighting the good fight: good error handling is the cornerstone of a maintainable system.  I don&#8217;t agree w/ the Effective Java quote, tho.</p>
<p>&#8220;Use checked exceptions for recoverable conditions&#8230;&#8221;<br />
What percentage of the Exceptions in your code relate to a recoverable conditions?  I maintain a large webapp, and my personal answer is &#8220;very few, maybe none&#8221;.  I want to handle errors, I really do.</p>
<p>&#8220;and runtime exceptions for programming errors&#8221;<br />
Runtime Exceptions have a very big problem - they produce awful stack traces.  Checked exceptions, used properly, get caught and wrapped at every level of the call stack, and end up providing all kinds of juicy data when you are reading over the stack.  Why should programming errors have awful stack traces?  They&#8217;re way more common than recoverable problems, and just as import to diagnose.</p>
<p>I don&#8217;t have any great solutions, just wanted to point out I rarely see opportunities for meaningful recovery, and that I hate stack traces caused by RuntimeExceptions slipping up to the top of the call stack w/ no chaining.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://www.alittlemadness.com/2008/03/12/checked-exceptions-failed-experiment/#comment-58561</link>
		<author>Jason</author>
		<pubDate>Tue, 11 Mar 2008 18:18:59 +0000</pubDate>
		<guid>http://www.alittlemadness.com/2008/03/12/checked-exceptions-failed-experiment/#comment-58561</guid>
		<description>Hi Jose,

Thanks for your comment.  You raise a great point about documentation: even with a lot of effort, the docs will still get it wrong.  The only way to get them write is to have them verified automatically - which you get for free with a checked exception.</description>
		<content:encoded><![CDATA[<p>Hi Jose,</p>
<p>Thanks for your comment.  You raise a great point about documentation: even with a lot of effort, the docs will still get it wrong.  The only way to get them write is to have them verified automatically - which you get for free with a checked exception.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jose</title>
		<link>http://www.alittlemadness.com/2008/03/12/checked-exceptions-failed-experiment/#comment-58560</link>
		<author>Jose</author>
		<pubDate>Tue, 11 Mar 2008 18:15:05 +0000</pubDate>
		<guid>http://www.alittlemadness.com/2008/03/12/checked-exceptions-failed-experiment/#comment-58560</guid>
		<description>C# doesn't have checked exceptions. While that seems convenient while you're writing code, the problems become evident later when you realize that you should've caught certain exceptions. The documentation is often not very good about this.</description>
		<content:encoded><![CDATA[<p>C# doesn&#8217;t have checked exceptions. While that seems convenient while you&#8217;re writing code, the problems become evident later when you realize that you should&#8217;ve caught certain exceptions. The documentation is often not very good about this.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
