<?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: Checked exceptions I love you, but you have to go</title>
	<atom:link href="http://misko.hevery.com/2009/09/16/checked-exceptions-i-love-you-but-you-have-to-go/feed/" rel="self" type="application/rss+xml" />
	<link>http://misko.hevery.com/2009/09/16/checked-exceptions-i-love-you-but-you-have-to-go/</link>
	<description>Testability Explorer</description>
	<lastBuildDate>Fri, 30 Jul 2010 03:59:03 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Chris</title>
		<link>http://misko.hevery.com/2009/09/16/checked-exceptions-i-love-you-but-you-have-to-go/comment-page-1/#comment-3557</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Mon, 31 May 2010 16:39:53 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=558#comment-3557</guid>
		<description>Use checked and unchecked but make checked exceptions show compiler WARNINGS rather than ERRORS. Then use Suppress annotations to clean those up if you like.

I personally would not make an exception checked vs not checked based on which class it extended from but rather based on which ones were declared via the throws syntax and which ones were not.</description>
		<content:encoded><![CDATA[<p>Use checked and unchecked but make checked exceptions show compiler WARNINGS rather than ERRORS. Then use Suppress annotations to clean those up if you like.</p>
<p>I personally would not make an exception checked vs not checked based on which class it extended from but rather based on which ones were declared via the throws syntax and which ones were not.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bikas</title>
		<link>http://misko.hevery.com/2009/09/16/checked-exceptions-i-love-you-but-you-have-to-go/comment-page-1/#comment-2787</link>
		<dc:creator>Bikas</dc:creator>
		<pubDate>Sun, 10 Jan 2010 05:54:30 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=558#comment-2787</guid>
		<description>How to handle checked and unchecked exception.</description>
		<content:encoded><![CDATA[<p>How to handle checked and unchecked exception.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Florence Chabanois</title>
		<link>http://misko.hevery.com/2009/09/16/checked-exceptions-i-love-you-but-you-have-to-go/comment-page-1/#comment-2717</link>
		<dc:creator>Florence Chabanois</dc:creator>
		<pubDate>Sat, 02 Jan 2010 14:10:56 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=558#comment-2717</guid>
		<description>Hey happy New Year !

&quot;why exactly do we need them? To remind you that you need to catch business level error&quot;
=&gt; &quot;need&quot; might be a strong word, it is more about knowing which (business) exception a certain method can throw, so that I can deal with it if I want, like a warning. Sure I can have a look on the tests to see which (business) exception a service can throw but it is even clearer if it is on the signature. And what if we don&#039;t have the sources? Worth what if there are no tests (yeaaaah then maybe I should not use the API at all ;-))

You have a point with the other languages. I wonder how it is done to know which (business) exception can be thrown by a service. Do we just forget to deal with it? Do we deal with all the exception in only one way? Is there more test in the others languages? 

I guess you said it all with : &quot;Yes, tell me which exceptions you will throw, but don’t make me catch them if I know i don’t need to.&quot;</description>
		<content:encoded><![CDATA[<p>Hey happy New Year !</p>
<p>&#8220;why exactly do we need them? To remind you that you need to catch business level error&#8221;<br />
=&gt; &#8220;need&#8221; might be a strong word, it is more about knowing which (business) exception a certain method can throw, so that I can deal with it if I want, like a warning. Sure I can have a look on the tests to see which (business) exception a service can throw but it is even clearer if it is on the signature. And what if we don&#8217;t have the sources? Worth what if there are no tests (yeaaaah then maybe I should not use the API at all <img src='http://misko.hevery.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> )</p>
<p>You have a point with the other languages. I wonder how it is done to know which (business) exception can be thrown by a service. Do we just forget to deal with it? Do we deal with all the exception in only one way? Is there more test in the others languages? </p>
<p>I guess you said it all with : &#8220;Yes, tell me which exceptions you will throw, but don’t make me catch them if I know i don’t need to.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: misko</title>
		<link>http://misko.hevery.com/2009/09/16/checked-exceptions-i-love-you-but-you-have-to-go/comment-page-1/#comment-2710</link>
		<dc:creator>misko</dc:creator>
		<pubDate>Fri, 01 Jan 2010 18:06:06 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=558#comment-2710</guid>
		<description>@Florence,

Perhaps you could convince me on business level exceptions, but why exactly do we need them? To remind you that you need to catch business level error? I think you should have lots of tests to prove that the exceptions are covered, since declaring it is no guarantee that you are handling it correct, but test is a pretty good example that you are handling it correct. And if you have test, what do you need an exception declaration for. 

You are right, I would be a lot less negative about checked exceptions if they were being used more sparingly, but they are not. Also, I find it interesting that there not many other languages which use them (I don&#039;t know of any). Would you claim that Java has less bugs because of them? I think not, so why make me type all these things. 

Perhaps what we need are hints. Yes, tell me which exceptions you will throw, but don&#039;t make me catch them if I know i don&#039;t need to.</description>
		<content:encoded><![CDATA[<p>@Florence,</p>
<p>Perhaps you could convince me on business level exceptions, but why exactly do we need them? To remind you that you need to catch business level error? I think you should have lots of tests to prove that the exceptions are covered, since declaring it is no guarantee that you are handling it correct, but test is a pretty good example that you are handling it correct. And if you have test, what do you need an exception declaration for. </p>
<p>You are right, I would be a lot less negative about checked exceptions if they were being used more sparingly, but they are not. Also, I find it interesting that there not many other languages which use them (I don&#8217;t know of any). Would you claim that Java has less bugs because of them? I think not, so why make me type all these things. </p>
<p>Perhaps what we need are hints. Yes, tell me which exceptions you will throw, but don&#8217;t make me catch them if I know i don&#8217;t need to.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Florence Chabanois</title>
		<link>http://misko.hevery.com/2009/09/16/checked-exceptions-i-love-you-but-you-have-to-go/comment-page-1/#comment-2701</link>
		<dc:creator>Florence Chabanois</dc:creator>
		<pubDate>Thu, 31 Dec 2009 22:49:08 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=558#comment-2701</guid>
		<description>Misko, I love your work and your post is quite convincing. But seriously, you NEVER find check exception useful? Even for exceptions related to business such as mmm an duplicate login? Seeing this kind of exceptions in the signature warn us that we have to deal with it in a special way, for example adding an error message to the action, to warn the user. If we don&#039;t have these kind of warnings, we may forget to deal with it when testing the action, although the login service was dealing with this case. I have trouble refraining myself from using checked exceptions for these cases for now. But I would love to know why I&#039;m wrong :-)</description>
		<content:encoded><![CDATA[<p>Misko, I love your work and your post is quite convincing. But seriously, you NEVER find check exception useful? Even for exceptions related to business such as mmm an duplicate login? Seeing this kind of exceptions in the signature warn us that we have to deal with it in a special way, for example adding an error message to the action, to warn the user. If we don&#8217;t have these kind of warnings, we may forget to deal with it when testing the action, although the login service was dealing with this case. I have trouble refraining myself from using checked exceptions for these cases for now. But I would love to know why I&#8217;m wrong <img src='http://misko.hevery.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Berlin Brown</title>
		<link>http://misko.hevery.com/2009/09/16/checked-exceptions-i-love-you-but-you-have-to-go/comment-page-1/#comment-2408</link>
		<dc:creator>Berlin Brown</dc:creator>
		<pubDate>Fri, 20 Nov 2009 21:37:29 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=558#comment-2408</guid>
		<description>It sounds like you aren&#039;t entirely against catching exceptions.  That is what I don&#039;t understand, is it OK to catch some exceptions or just throw and rethrow everything to the highest level in your application?

It just seems that if you do that, then your code will always have problems and errors.

At least with catching exceptions like FileNotFoundException and dead code, the application is able to continue.</description>
		<content:encoded><![CDATA[<p>It sounds like you aren&#8217;t entirely against catching exceptions.  That is what I don&#8217;t understand, is it OK to catch some exceptions or just throw and rethrow everything to the highest level in your application?</p>
<p>It just seems that if you do that, then your code will always have problems and errors.</p>
<p>At least with catching exceptions like FileNotFoundException and dead code, the application is able to continue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Howard</title>
		<link>http://misko.hevery.com/2009/09/16/checked-exceptions-i-love-you-but-you-have-to-go/comment-page-1/#comment-2284</link>
		<dc:creator>Dan Howard</dc:creator>
		<pubDate>Fri, 06 Nov 2009 20:24:48 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=558#comment-2284</guid>
		<description>Checked exceptions within the Java API should be removed. They could do it by moving them all extend RuntimeExceptions.

IMO Checked exceptions belong in the domain only.</description>
		<content:encoded><![CDATA[<p>Checked exceptions within the Java API should be removed. They could do it by moving them all extend RuntimeExceptions.</p>
<p>IMO Checked exceptions belong in the domain only.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Blog - all about IT &#187; O testach wydajnościowych słów kilka</title>
		<link>http://misko.hevery.com/2009/09/16/checked-exceptions-i-love-you-but-you-have-to-go/comment-page-1/#comment-2281</link>
		<dc:creator>Blog - all about IT &#187; O testach wydajnościowych słów kilka</dc:creator>
		<pubDate>Fri, 06 Nov 2009 14:18:15 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=558#comment-2281</guid>
		<description>[...] wydajnościowe, jak to testy&#8230; robić trzeba. Jak to pisze Misko: You do test, right? Zazwyczaj aby je przeprowadzić korzystałem z Apache JMeter. Polecam ten program i może nawet [...]</description>
		<content:encoded><![CDATA[<p>[...] wydajnościowe, jak to testy&#8230; robić trzeba. Jak to pisze Misko: You do test, right? Zazwyczaj aby je przeprowadzić korzystałem z Apache JMeter. Polecam ten program i może nawet [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dmitry S</title>
		<link>http://misko.hevery.com/2009/09/16/checked-exceptions-i-love-you-but-you-have-to-go/comment-page-1/#comment-2110</link>
		<dc:creator>Dmitry S</dc:creator>
		<pubDate>Sat, 17 Oct 2009 15:03:12 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=558#comment-2110</guid>
		<description>I more agree with Michael than with others.
I think checked exceptions help writing solid code.
Even if I have to re-throw, I add usual context info.
Example: NullPointerException. It is useless to see NPE without details on data that caused it.
If NPE were checked,  programmers would at least log it along with related data. It would be much easier to report and reproduce it. And all NPE would gone :-)

Since many love unchecked exceptions, world is filled with brittle programs working only the way they were tested. 

100% coverage of my module doesn&#039;t help. Because my module misses 50% of cases when underlying libraries return/throw something unusual.

It is known as defects of commission and defects of omission. Coverage helps with commission. Checked exceptions/contracts help with omission.

I agree I often write fluky programs. It would be useful to switch checked exceptions off for such projects. (For example, see http://projectlombok.org/disableCheckedExceptions.html)

But sometimes I write server-side production code. I would make all exceptions checked there. And I would use only libraries that compile in all-exceptions-checked mode.</description>
		<content:encoded><![CDATA[<p>I more agree with Michael than with others.<br />
I think checked exceptions help writing solid code.<br />
Even if I have to re-throw, I add usual context info.<br />
Example: NullPointerException. It is useless to see NPE without details on data that caused it.<br />
If NPE were checked,  programmers would at least log it along with related data. It would be much easier to report and reproduce it. And all NPE would gone <img src='http://misko.hevery.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Since many love unchecked exceptions, world is filled with brittle programs working only the way they were tested. </p>
<p>100% coverage of my module doesn&#8217;t help. Because my module misses 50% of cases when underlying libraries return/throw something unusual.</p>
<p>It is known as defects of commission and defects of omission. Coverage helps with commission. Checked exceptions/contracts help with omission.</p>
<p>I agree I often write fluky programs. It would be useful to switch checked exceptions off for such projects. (For example, see <a href="http://projectlombok.org/disableCheckedExceptions.html)" rel="nofollow">http://projectlombok.org/disableCheckedExceptions.html)</a></p>
<p>But sometimes I write server-side production code. I would make all exceptions checked there. And I would use only libraries that compile in all-exceptions-checked mode.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Przemek</title>
		<link>http://misko.hevery.com/2009/09/16/checked-exceptions-i-love-you-but-you-have-to-go/comment-page-1/#comment-1909</link>
		<dc:creator>Przemek</dc:creator>
		<pubDate>Sun, 20 Sep 2009 20:05:14 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=558#comment-1909</guid>
		<description>Few people know the Fault-Contingency exception hangling scheme by Barry Ruzek. Not perfect, though, it provides some useful vocabulary to talk about exceptions.
There was interresting discussion on that topic already:
http://www.theserverside.com/news/thread.tss?thread_id=43820

The over-simplified summary:
1. put a fault-bareer early in the call tree, log all errors or display them to the user there
2. use unchecked exceptions almost everywhere
3. use checked exceptions in case of Contingencies - where &quot;Contingency - An expected condition demanding an alternative response from a method that can be expressed in terms of the method&#039;s intended purpose. The caller of the method expects these kinds of conditions and has a strategy for coping with them.&quot;

This way, you have your app secured (by fault-bareers), unnecessary exceptions don&#039;t pollute your code and compiler helps you when you want to.

Clearly, some problems with checked exceptions remain (when you use functional style for example), but Barry&#039;s rules help in most cases - I can recommend them.</description>
		<content:encoded><![CDATA[<p>Few people know the Fault-Contingency exception hangling scheme by Barry Ruzek. Not perfect, though, it provides some useful vocabulary to talk about exceptions.<br />
There was interresting discussion on that topic already:<br />
<a href="http://www.theserverside.com/news/thread.tss?thread_id=43820" rel="nofollow">http://www.theserverside.com/news/thread.tss?thread_id=43820</a></p>
<p>The over-simplified summary:<br />
1. put a fault-bareer early in the call tree, log all errors or display them to the user there<br />
2. use unchecked exceptions almost everywhere<br />
3. use checked exceptions in case of Contingencies &#8211; where &#8220;Contingency &#8211; An expected condition demanding an alternative response from a method that can be expressed in terms of the method&#8217;s intended purpose. The caller of the method expects these kinds of conditions and has a strategy for coping with them.&#8221;</p>
<p>This way, you have your app secured (by fault-bareers), unnecessary exceptions don&#8217;t pollute your code and compiler helps you when you want to.</p>
<p>Clearly, some problems with checked exceptions remain (when you use functional style for example), but Barry&#8217;s rules help in most cases &#8211; I can recommend them.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
