<?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: Voting for Checked Exceptions</title>
	<atom:link href="http://cafe.elharo.com/blogroll/voting-for-checked-exceptions/feed/" rel="self" type="application/rss+xml" />
	<link>http://cafe.elharo.com/blogroll/voting-for-checked-exceptions/</link>
	<description>Longer than a blog; shorter than a book</description>
	<lastBuildDate>Tue, 09 Mar 2010 18:31:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: pp</title>
		<link>http://cafe.elharo.com/blogroll/voting-for-checked-exceptions/comment-page-3/#comment-462356</link>
		<dc:creator>pp</dc:creator>
		<pubDate>Thu, 11 Feb 2010 16:24:20 +0000</pubDate>
		<guid isPermaLink="false">http://cafe.elharo.com/java/voting-for-checked-exceptions/#comment-462356</guid>
		<description>HI,

Nice comments... we must begin with  &quot;an error is an error&quot; in any language, waht can be done whe someone delete alll records in a table ? mmm ... Maybe another confussion is that in Java some programmesr trend to use them as an business validation .. I mean, some one uses &quot;throw exception&quot; to inform that the password was wrong .....

Uses checked or unchecked exceptions don&#039;t guarantee that you have a robust application .. we are human, we make mistake. Using cehcked exception tell us what we must not forget... but ... I watched a lot of code with try{ ... }catch(Exception e){ null; } (senior java, maybe a little tired) ... trying to prevent to manage the error ... It&#039;s no nice, it is better let&#039;s flows the real error.

I repeat we are not working with geniouses we work with real guys, with personal problems and another issues,  our mission it&#039;s to help them,,.. My position, I really hate to use checked exception ... I repeat, an error is an error no way treat with them ..

I don&#039;t know, how much experience has Harold with other language (C, ADA, Lips, Cobol) and building real applications?, where you must be &quot;quick&quot; and go live soon as posible, when you must fight wiht legacy code ....  to use a checked exception and don&#039;t forget to catch every error in the system could be a nightmare code ?? I think (with respect), Harol is a great theorical guy, who can teach and write great books.. 

With Respect.</description>
		<content:encoded><![CDATA[<p>HI,</p>
<p>Nice comments&#8230; we must begin with  &#8220;an error is an error&#8221; in any language, waht can be done whe someone delete alll records in a table ? mmm &#8230; Maybe another confussion is that in Java some programmesr trend to use them as an business validation .. I mean, some one uses &#8220;throw exception&#8221; to inform that the password was wrong &#8230;..</p>
<p>Uses checked or unchecked exceptions don&#8217;t guarantee that you have a robust application .. we are human, we make mistake. Using cehcked exception tell us what we must not forget&#8230; but &#8230; I watched a lot of code with try{ &#8230; }catch(Exception e){ null; } (senior java, maybe a little tired) &#8230; trying to prevent to manage the error &#8230; It&#8217;s no nice, it is better let&#8217;s flows the real error.</p>
<p>I repeat we are not working with geniouses we work with real guys, with personal problems and another issues,  our mission it&#8217;s to help them,,.. My position, I really hate to use checked exception &#8230; I repeat, an error is an error no way treat with them ..</p>
<p>I don&#8217;t know, how much experience has Harold with other language (C, ADA, Lips, Cobol) and building real applications?, where you must be &#8220;quick&#8221; and go live soon as posible, when you must fight wiht legacy code &#8230;.  to use a checked exception and don&#8217;t forget to catch every error in the system could be a nightmare code ?? I think (with respect), Harol is a great theorical guy, who can teach and write great books.. </p>
<p>With Respect.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elliotte Rusty Harold</title>
		<link>http://cafe.elharo.com/blogroll/voting-for-checked-exceptions/comment-page-3/#comment-432431</link>
		<dc:creator>Elliotte Rusty Harold</dc:creator>
		<pubDate>Tue, 18 Aug 2009 19:54:38 +0000</pubDate>
		<guid isPermaLink="false">http://cafe.elharo.com/java/voting-for-checked-exceptions/#comment-432431</guid>
		<description>MalformedURLException is a checked exception because it reflects whether the running VM has the right protocol handler installed. One VM can throw a MalformedURLException for a URL for which another VM won&#039;t. There is no way to guarantee at compile whether the code that constructs a java.net.URL will or will not throw  an exception. 

SQLException is a checked exception because the SQL string is evaluated by the database server (or the JDBC driver), and different servers accept different dialects of SQL. Again, you can&#039;t tell at compile time whether the exception will or will not occur.  Therefore SQLException is properly a checked exception. 

URISyntaxException is one Sun got wrong. It should be a runtime exception because it doesn&#039;t depend on the environment in which it executes and it can be verified at compile time. Basically it&#039;s a type of IllegalArgumentException like NumberFormatException. However, it isn&#039;t. It&#039;s a checked exception. That&#039;s simply a mistake.</description>
		<content:encoded><![CDATA[<p>MalformedURLException is a checked exception because it reflects whether the running VM has the right protocol handler installed. One VM can throw a MalformedURLException for a URL for which another VM won&#8217;t. There is no way to guarantee at compile whether the code that constructs a java.net.URL will or will not throw  an exception. </p>
<p>SQLException is a checked exception because the SQL string is evaluated by the database server (or the JDBC driver), and different servers accept different dialects of SQL. Again, you can&#8217;t tell at compile time whether the exception will or will not occur.  Therefore SQLException is properly a checked exception. </p>
<p>URISyntaxException is one Sun got wrong. It should be a runtime exception because it doesn&#8217;t depend on the environment in which it executes and it can be verified at compile time. Basically it&#8217;s a type of IllegalArgumentException like NumberFormatException. However, it isn&#8217;t. It&#8217;s a checked exception. That&#8217;s simply a mistake.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: constv</title>
		<link>http://cafe.elharo.com/blogroll/voting-for-checked-exceptions/comment-page-3/#comment-432424</link>
		<dc:creator>constv</dc:creator>
		<pubDate>Tue, 18 Aug 2009 19:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://cafe.elharo.com/java/voting-for-checked-exceptions/#comment-432424</guid>
		<description>&quot;With that being sad I do not see checked exceptions being taken away from Java anytime soon as it would clash millions of lines of code.&quot;

I am not so sure. If the Exception class is re-factored to become &quot;unchecked&quot;, the existing code (that now successfully compiles) should still continue to work in the same manner. It&#039;s just that billions of lines of today&#039;s code that are wasted on catching and re-throwing will become redundant (in those cases when the programmer is indeed trying to properly propagate a checked exception instead of mishandling it way before it reaches the place where it should and can be properly handled.)

Also, here&#039;s the more accurate link to the article I mentioned in the previous post:
http://constv.blogspot.com/2009/08/error-handling-and-exceptions-in-java.html</description>
		<content:encoded><![CDATA[<p>&#8220;With that being sad I do not see checked exceptions being taken away from Java anytime soon as it would clash millions of lines of code.&#8221;</p>
<p>I am not so sure. If the Exception class is re-factored to become &#8220;unchecked&#8221;, the existing code (that now successfully compiles) should still continue to work in the same manner. It&#8217;s just that billions of lines of today&#8217;s code that are wasted on catching and re-throwing will become redundant (in those cases when the programmer is indeed trying to properly propagate a checked exception instead of mishandling it way before it reaches the place where it should and can be properly handled.)</p>
<p>Also, here&#8217;s the more accurate link to the article I mentioned in the previous post:<br />
<a href="http://constv.blogspot.com/2009/08/error-handling-and-exceptions-in-java.html" rel="nofollow">http://constv.blogspot.com/2009/08/error-handling-and-exceptions-in-java.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: constv</title>
		<link>http://cafe.elharo.com/blogroll/voting-for-checked-exceptions/comment-page-3/#comment-432419</link>
		<dc:creator>constv</dc:creator>
		<pubDate>Tue, 18 Aug 2009 19:14:41 +0000</pubDate>
		<guid isPermaLink="false">http://cafe.elharo.com/java/voting-for-checked-exceptions/#comment-432419</guid>
		<description>The author expresses a very strong opinion - specifically, stating that anyone who is against checked exceptions doesn&#039;t understand the difference between checked and unchecked, but states that he doesn&#039;t have time to explain that very difference. Instead, as many checked exception zealots, he hides behind a book by a respectable author. In other words, &quot;checked exceptions may not be a bad idea because the authors of Java said that they are good, and who are we to argue with the Gods?&quot; (By the way, the newer specs from Sun, such as EJB 3.x, DO NOT contain checked exceptions. Need any more hints?) The opinion is based on the lack of understanding of what exceptions (the original concept!) are for, in the first place.  Checked exceptions are, perhaps, the worst and the most dangerous feature ever introduced in a programming language. I have never - I mean, ever! - seen checked exceptions being used properly. They always introduce chaos and cause essential error information to be lost.  It is much easier to design clean and reliable error handling with runtime exceptions only than to ensure the correct propagation and handling of checked exceptions. The sad reality is that it has become an EGO issue for those cocky programmers and architects who have failed to see the flaws of checked exceptions for years, and now are getting ticked off by other people pointing at it. For most such people it;s just a matter of pride and unwillingness to admit that they used to do it the wrong way. I have been programming in Java for over 10 years, and originally had bought into the checked hype. It took me some time (as well as some excellent advice/insight from a brilliant co-worker) to see the truth for myself, and to admit that I had been missing the point.  Amazingly, it doesn&#039;t take much to make perfect sense of exceptions (and I mean UNchecked ones.)   I have written an article on the subject where I honestly attempted to analyze the role of exceptions in error handling, the difference between checked and unchecked exceptions, and the benefits (if any) and flaws of the &quot;checked&quot; concept.  The article can be found here:
  
http://constv.blogspot.com/

Hope that helps someone.</description>
		<content:encoded><![CDATA[<p>The author expresses a very strong opinion &#8211; specifically, stating that anyone who is against checked exceptions doesn&#8217;t understand the difference between checked and unchecked, but states that he doesn&#8217;t have time to explain that very difference. Instead, as many checked exception zealots, he hides behind a book by a respectable author. In other words, &#8220;checked exceptions may not be a bad idea because the authors of Java said that they are good, and who are we to argue with the Gods?&#8221; (By the way, the newer specs from Sun, such as EJB 3.x, DO NOT contain checked exceptions. Need any more hints?) The opinion is based on the lack of understanding of what exceptions (the original concept!) are for, in the first place.  Checked exceptions are, perhaps, the worst and the most dangerous feature ever introduced in a programming language. I have never &#8211; I mean, ever! &#8211; seen checked exceptions being used properly. They always introduce chaos and cause essential error information to be lost.  It is much easier to design clean and reliable error handling with runtime exceptions only than to ensure the correct propagation and handling of checked exceptions. The sad reality is that it has become an EGO issue for those cocky programmers and architects who have failed to see the flaws of checked exceptions for years, and now are getting ticked off by other people pointing at it. For most such people it;s just a matter of pride and unwillingness to admit that they used to do it the wrong way. I have been programming in Java for over 10 years, and originally had bought into the checked hype. It took me some time (as well as some excellent advice/insight from a brilliant co-worker) to see the truth for myself, and to admit that I had been missing the point.  Amazingly, it doesn&#8217;t take much to make perfect sense of exceptions (and I mean UNchecked ones.)   I have written an article on the subject where I honestly attempted to analyze the role of exceptions in error handling, the difference between checked and unchecked exceptions, and the benefits (if any) and flaws of the &#8220;checked&#8221; concept.  The article can be found here:</p>
<p><a href="http://constv.blogspot.com/" rel="nofollow">http://constv.blogspot.com/</a></p>
<p>Hope that helps someone.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rrr</title>
		<link>http://cafe.elharo.com/blogroll/voting-for-checked-exceptions/comment-page-3/#comment-432166</link>
		<dc:creator>rrr</dc:creator>
		<pubDate>Mon, 17 Aug 2009 23:57:05 +0000</pubDate>
		<guid isPermaLink="false">http://cafe.elharo.com/java/voting-for-checked-exceptions/#comment-432166</guid>
		<description>With that being sad I do not see checked exceptions being taken away from Java anytime soon as it would clash millions of lines of code.</description>
		<content:encoded><![CDATA[<p>With that being sad I do not see checked exceptions being taken away from Java anytime soon as it would clash millions of lines of code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rrr</title>
		<link>http://cafe.elharo.com/blogroll/voting-for-checked-exceptions/comment-page-3/#comment-432165</link>
		<dc:creator>rrr</dc:creator>
		<pubDate>Mon, 17 Aug 2009 23:52:54 +0000</pubDate>
		<guid isPermaLink="false">http://cafe.elharo.com/java/voting-for-checked-exceptions/#comment-432165</guid>
		<description>An author is wrong. Checked exceptions do NOT disambiguate between external situations that programmer has no influence upon and obvious programming bugs that should never happen in the first place. As example take SQLException: it&#039;s one case when sql server is down/has maximum number of connections exceeded/we, but it&#039;s completely different if it&#039;s up and running and we try to insert sloppily generated data that infringe FK constraints. Or take getting website&#039;s source code by URL: it&#039;s one case when server/DNS is down or you lost your internet connection, but how about passing malformed URL to the method?

This makes checked exceptions dangerous as one may assume that it&#039;s handled, so this piece of code can cause no bugs. As it turns out URL is malformed or data is generated the wrong way, you get exception, you handle it as if it was sth external and forget about it. You think this is the right approach?</description>
		<content:encoded><![CDATA[<p>An author is wrong. Checked exceptions do NOT disambiguate between external situations that programmer has no influence upon and obvious programming bugs that should never happen in the first place. As example take SQLException: it&#8217;s one case when sql server is down/has maximum number of connections exceeded/we, but it&#8217;s completely different if it&#8217;s up and running and we try to insert sloppily generated data that infringe FK constraints. Or take getting website&#8217;s source code by URL: it&#8217;s one case when server/DNS is down or you lost your internet connection, but how about passing malformed URL to the method?</p>
<p>This makes checked exceptions dangerous as one may assume that it&#8217;s handled, so this piece of code can cause no bugs. As it turns out URL is malformed or data is generated the wrong way, you get exception, you handle it as if it was sth external and forget about it. You think this is the right approach?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://cafe.elharo.com/blogroll/voting-for-checked-exceptions/comment-page-3/#comment-387266</link>
		<dc:creator>John</dc:creator>
		<pubDate>Mon, 20 Apr 2009 21:01:28 +0000</pubDate>
		<guid isPermaLink="false">http://cafe.elharo.com/java/voting-for-checked-exceptions/#comment-387266</guid>
		<description>I  know this is an old topic, but it&#039;s still one of interest.

Checked exceptions are good.

The only complaint I&#039;ve found interesting is what to do if I need to include another checked exception as part of the method signature?

Really, there&#039;s only a handful of solutions:  
1.  Break compatibility (rarely a viable for commercial APIs)
2.  Subclass one of the already declared exceptions--provided it really is a meaningful suclass--and preserve the method signature (least evil approach).
3.  Throw the exception as an unchecked exception.

#3 is what we&#039;d get anyway, if Java were to dispense with unchecked exceptions.

#2 Requires good exception design from day one.  The problem is that most API writers slap together exceptions as an after-thought, rather than making it a part of the design from the get-go.  You want your base exception classes to be meaningful, but not so specific that you trap yourself later (easier said than done).

It&#039;s still not ideal, since I don&#039;t have an auto-documented way of knowing exactly what subclass may be thrown by the method.  But imho, it&#039;s still quite viable.</description>
		<content:encoded><![CDATA[<p>I  know this is an old topic, but it&#8217;s still one of interest.</p>
<p>Checked exceptions are good.</p>
<p>The only complaint I&#8217;ve found interesting is what to do if I need to include another checked exception as part of the method signature?</p>
<p>Really, there&#8217;s only a handful of solutions:<br />
1.  Break compatibility (rarely a viable for commercial APIs)<br />
2.  Subclass one of the already declared exceptions&#8211;provided it really is a meaningful suclass&#8211;and preserve the method signature (least evil approach).<br />
3.  Throw the exception as an unchecked exception.</p>
<p>#3 is what we&#8217;d get anyway, if Java were to dispense with unchecked exceptions.</p>
<p>#2 Requires good exception design from day one.  The problem is that most API writers slap together exceptions as an after-thought, rather than making it a part of the design from the get-go.  You want your base exception classes to be meaningful, but not so specific that you trap yourself later (easier said than done).</p>
<p>It&#8217;s still not ideal, since I don&#8217;t have an auto-documented way of knowing exactly what subclass may be thrown by the method.  But imho, it&#8217;s still quite viable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ralph</title>
		<link>http://cafe.elharo.com/blogroll/voting-for-checked-exceptions/comment-page-3/#comment-244374</link>
		<dc:creator>ralph</dc:creator>
		<pubDate>Thu, 03 Jul 2008 19:05:13 +0000</pubDate>
		<guid isPermaLink="false">http://cafe.elharo.com/java/voting-for-checked-exceptions/#comment-244374</guid>
		<description>I wrote a service/daemon which scans several web sites, processes their content and uploads results into the database. Obviously it is supposed to be entirely transparent to the end user - no messages that something is wrong, it must try until it succeeds. So, various things can go wrong - database may be down, server may be unreachable, etc. But it doesn&#039;t care AT ALL, what&#039;s wrong - it&#039;s sufficient to know that SOMETHING went wrong to try again shortly. So, what&#039;s the point of checked exceptions here?

Regards</description>
		<content:encoded><![CDATA[<p>I wrote a service/daemon which scans several web sites, processes their content and uploads results into the database. Obviously it is supposed to be entirely transparent to the end user &#8211; no messages that something is wrong, it must try until it succeeds. So, various things can go wrong &#8211; database may be down, server may be unreachable, etc. But it doesn&#8217;t care AT ALL, what&#8217;s wrong &#8211; it&#8217;s sufficient to know that SOMETHING went wrong to try again shortly. So, what&#8217;s the point of checked exceptions here?</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elliotte Rusty Harold</title>
		<link>http://cafe.elharo.com/blogroll/voting-for-checked-exceptions/comment-page-3/#comment-232871</link>
		<dc:creator>Elliotte Rusty Harold</dc:creator>
		<pubDate>Fri, 30 May 2008 13:06:20 +0000</pubDate>
		<guid isPermaLink="false">http://cafe.elharo.com/java/voting-for-checked-exceptions/#comment-232871</guid>
		<description>Bruce at least has backed way off from that position, to the extent that he ever held it at all. The problem arises not from checked exceptions, but from using checked exceptions where runtime exceptions are appropriate. Using nothing but checked exceptions would indeed be atrocious. Fortunately that&#039;s never been necessary, and hasn&#039;t even been all that  common for the last six years or so (since &lt;a href=&#039;http://java.sun.com/docs/books/effective/&#039; rel=&quot;nofollow&quot;&gt;&lt;cite&gt;Effective Java&lt;/cite&gt;&lt;/a&gt; came out).

The &quot;orthodox&quot; position is not what you seem to think it is. Using nothing but checked exceptions has never been the orthodox position, though it&#039;s perhaps been parodied that way by developers who still don&#039;t want to spend time on error handling, with checked exceptions or otherwise.</description>
		<content:encoded><![CDATA[<p>Bruce at least has backed way off from that position, to the extent that he ever held it at all. The problem arises not from checked exceptions, but from using checked exceptions where runtime exceptions are appropriate. Using nothing but checked exceptions would indeed be atrocious. Fortunately that&#8217;s never been necessary, and hasn&#8217;t even been all that  common for the last six years or so (since <a href='http://java.sun.com/docs/books/effective/' rel="nofollow"><cite>Effective Java</cite></a> came out).</p>
<p>The &#8220;orthodox&#8221; position is not what you seem to think it is. Using nothing but checked exceptions has never been the orthodox position, though it&#8217;s perhaps been parodied that way by developers who still don&#8217;t want to spend time on error handling, with checked exceptions or otherwise.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Herman</title>
		<link>http://cafe.elharo.com/blogroll/voting-for-checked-exceptions/comment-page-3/#comment-232488</link>
		<dc:creator>Eric Herman</dc:creator>
		<pubDate>Thu, 29 May 2008 21:56:06 +0000</pubDate>
		<guid isPermaLink="false">http://cafe.elharo.com/java/voting-for-checked-exceptions/#comment-232488</guid>
		<description>2004 IBM &quot;Java theory and practice&quot; quote in-escapable:


    Recently, several well-regarded experts, including Bruce Eckel
    and Rod Johnson, have publicly stated that while they initially
    agreed completely with the orthodox position on checked
    exceptions, they&#039;ve concluded that exclusive use of checked
    exceptions is not as good an idea as it appeared at first, and
    that checked exceptions have become a significant source of
    problems for many large projects.

http://www.ibm.com/developerworks/java/library/j-jtp05254.html

http://www.tiedyedfreaks.org/eric/CheckedExceptions.xhtml</description>
		<content:encoded><![CDATA[<p>2004 IBM &#8220;Java theory and practice&#8221; quote in-escapable:</p>
<p>    Recently, several well-regarded experts, including Bruce Eckel<br />
    and Rod Johnson, have publicly stated that while they initially<br />
    agreed completely with the orthodox position on checked<br />
    exceptions, they&#8217;ve concluded that exclusive use of checked<br />
    exceptions is not as good an idea as it appeared at first, and<br />
    that checked exceptions have become a significant source of<br />
    problems for many large projects.</p>
<p><a href="http://www.ibm.com/developerworks/java/library/j-jtp05254.html" rel="nofollow">http://www.ibm.com/developerworks/java/library/j-jtp05254.html</a></p>
<p><a href="http://www.tiedyedfreaks.org/eric/CheckedExceptions.xhtml" rel="nofollow">http://www.tiedyedfreaks.org/eric/CheckedExceptions.xhtml</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
