<?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: Tools of the Effective Developer: Error Handling Infrastructure</title>
	<atom:link href="http://www.hans-eric.com/2009/09/03/tools-of-the-effective-developer-error-handling-infrastructure/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hans-eric.com/2009/09/03/tools-of-the-effective-developer-error-handling-infrastructure/</link>
	<description>Hans-Eric Grönlund on software development</description>
	<lastBuildDate>Thu, 29 Jul 2010 15:10:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Hans-Eric</title>
		<link>http://www.hans-eric.com/2009/09/03/tools-of-the-effective-developer-error-handling-infrastructure/comment-page-1/#comment-35656</link>
		<dc:creator>Hans-Eric</dc:creator>
		<pubDate>Thu, 10 Sep 2009 10:05:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.hans-eric.com/?p=193#comment-35656</guid>
		<description>&lt;a href=&quot;#comment-35633&quot; rel=&quot;nofollow&quot;&gt;@Paul W. Homer &lt;/a&gt; 
&quot;I even skipped all error handling as a deranged form of optimization&quot;

Ha ha! I thought the only reasons could be laziness or ignorance, but deliberately skipping error handling as an optimization, that was new to me. Classic! :-)

&quot;My philosophy for Object Oriented: handle it “low” or handle it “high”, but nothing in the middle.&quot;

For once I have to gently disagree with you. My philosophy is: Handle the error where it makes sence. 
This usually means handling it &quot;low&quot; or &quot;high&quot; (in fact more often high, in the GUI layer), but not always. It happens sometimes that I find situations where it makes sence to handle errors in the middle tire.

&quot;don’t throw an error if some other return value is also appropriate&quot;

The thing here is not to mute information about an error that could help identifing problems. A return value can only tell you OK, or NOT OK but nothing more. This is fine for really low level functions (like malloc) but should be avoided otherwise.

But! If we&#039;re not talking about an actual error, like for instance a search that resulted in no hits, then of course a return value is the correct way to handle it. Exceptions should not be used for anything other than exceptional (invalid) program states.</description>
		<content:encoded><![CDATA[<p><a href="#comment-35633" rel="nofollow">@Paul W. Homer </a><br />
&#8220;I even skipped all error handling as a deranged form of optimization&#8221;</p>
<p>Ha ha! I thought the only reasons could be laziness or ignorance, but deliberately skipping error handling as an optimization, that was new to me. Classic! <img src='http://www.hans-eric.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>&#8220;My philosophy for Object Oriented: handle it “low” or handle it “high”, but nothing in the middle.&#8221;</p>
<p>For once I have to gently disagree with you. My philosophy is: Handle the error where it makes sence.<br />
This usually means handling it &#8220;low&#8221; or &#8220;high&#8221; (in fact more often high, in the GUI layer), but not always. It happens sometimes that I find situations where it makes sence to handle errors in the middle tire.</p>
<p>&#8220;don’t throw an error if some other return value is also appropriate&#8221;</p>
<p>The thing here is not to mute information about an error that could help identifing problems. A return value can only tell you OK, or NOT OK but nothing more. This is fine for really low level functions (like malloc) but should be avoided otherwise.</p>
<p>But! If we&#8217;re not talking about an actual error, like for instance a search that resulted in no hits, then of course a return value is the correct way to handle it. Exceptions should not be used for anything other than exceptional (invalid) program states.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul W. Homer</title>
		<link>http://www.hans-eric.com/2009/09/03/tools-of-the-effective-developer-error-handling-infrastructure/comment-page-1/#comment-35633</link>
		<dc:creator>Paul W. Homer</dc:creator>
		<pubDate>Wed, 09 Sep 2009 18:16:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.hans-eric.com/?p=193#comment-35633</guid>
		<description>It&#039;s funny that the one bit of functionality that you can guarantee every program must have -- handling errors -- is the one that some many programmer leave as an after-thought. Once when I was really young, I even skipped all error handling as a deranged form of optimization (I choice I regretted years later, when I ended up having to debug a port of the code). 

My philosophy for Object Oriented: handle it &quot;low&quot; or handle it &quot;high&quot;, but nothing in the middle. That is, either catch the error right away and do something useful with it, or allow it to propagate up to one big general error handler and have it dealt with there. Also, don&#039;t throw an error if some other return value is also appropriate, e.g., return null or an empty list instead (and in-band signal like -1 is also appropriate).

Paul.</description>
		<content:encoded><![CDATA[<p>It&#8217;s funny that the one bit of functionality that you can guarantee every program must have &#8212; handling errors &#8212; is the one that some many programmer leave as an after-thought. Once when I was really young, I even skipped all error handling as a deranged form of optimization (I choice I regretted years later, when I ended up having to debug a port of the code). </p>
<p>My philosophy for Object Oriented: handle it &#8220;low&#8221; or handle it &#8220;high&#8221;, but nothing in the middle. That is, either catch the error right away and do something useful with it, or allow it to propagate up to one big general error handler and have it dealt with there. Also, don&#8217;t throw an error if some other return value is also appropriate, e.g., return null or an empty list instead (and in-band signal like -1 is also appropriate).</p>
<p>Paul.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Helltime for September 7 &#171; I Built His Cage</title>
		<link>http://www.hans-eric.com/2009/09/03/tools-of-the-effective-developer-error-handling-infrastructure/comment-page-1/#comment-35578</link>
		<dc:creator>Helltime for September 7 &#171; I Built His Cage</dc:creator>
		<pubDate>Mon, 07 Sep 2009 20:02:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.hans-eric.com/?p=193#comment-35578</guid>
		<description>[...] Eric Gronlund gives an appetizing future look at a future Code H&#8217;yung about designing a logging framework. It&#8217;s either that or a [...]</description>
		<content:encoded><![CDATA[<p>[...] Eric Gronlund gives an appetizing future look at a future Code H&#8217;yung about designing a logging framework. It&#8217;s either that or a [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.340 seconds -->
