<?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/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	
	>
<channel>
	<title>
	Comments on: The Exception Bogeyman	</title>
	<atom:link href="https://www.robg3d.com/2011/05/exceptions-again/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.robg3d.com/2011/05/exceptions-again/</link>
	<description>Blog of Rob Galanakis (@robgalanakis)</description>
	<lastBuildDate>Mon, 11 Jul 2011 03:45:49 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.4.1</generator>
	<item>
		<title>
		By: Chad Stewart		</title>
		<link>https://www.robg3d.com/2011/05/exceptions-again/#comment-3874</link>

		<dc:creator><![CDATA[Chad Stewart]]></dc:creator>
		<pubDate>Wed, 11 May 2011 02:06:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.robg3d.com/?p=373#comment-3874</guid>

					<description><![CDATA[&lt;a href=&quot;#comment-3873&quot; rel=&quot;nofollow&quot;&gt;@Chad Stewart&lt;/a&gt; 

Oh, and I think there&#039;s a big difference between flow control and being able to safely ignore / recover from an exception. The next step of execution shouldn&#039;t be relying on whether or not we got an exception. It should be able to safely continue, but it should not fork the logic. Perhaps a better example of this would be to catch the SqlException and decide to try it in Oracle. (In that example, go back to square one and use an Interface.) If you utilize an Exception to determine whether or not you&#039;ve been passed a null reference, maybe you need to rework that one a little bit.]]></description>
			<content:encoded><![CDATA[<p><a href="#comment-3873" rel="nofollow">@Chad Stewart</a> </p>
<p>Oh, and I think there&#8217;s a big difference between flow control and being able to safely ignore / recover from an exception. The next step of execution shouldn&#8217;t be relying on whether or not we got an exception. It should be able to safely continue, but it should not fork the logic. Perhaps a better example of this would be to catch the SqlException and decide to try it in Oracle. (In that example, go back to square one and use an Interface.) If you utilize an Exception to determine whether or not you&#8217;ve been passed a null reference, maybe you need to rework that one a little bit.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Chad Stewart		</title>
		<link>https://www.robg3d.com/2011/05/exceptions-again/#comment-3873</link>

		<dc:creator><![CDATA[Chad Stewart]]></dc:creator>
		<pubDate>Wed, 11 May 2011 01:05:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.robg3d.com/?p=373#comment-3873</guid>

					<description><![CDATA[Oh, Rob. I think we agree on different levels.

I&#039;m not saying exceptions are fundamentally flawed. I&#039;m saying reserve them for when things are absolutely out of your control, or for where you know 100% (not 99) that you can safely move past an exception without a problem. Those are what I think you can consider &quot;exceptional.&quot; 

I am fully in agreement when you say things like: &quot;Rewrite that code without exceptions and it doesn’t get any better. It may get faster, but the speed issue isn’t exceptions’ fault either- that is still just faulty code.&quot; &quot;Well, no one can say either- which is why null should be an invalid argument to Frob and Frob should throw an exception.&quot; However, I agree because I think try / catch usually gets added to the mix in the wrong occasions only to mask this.

The real questions here are why are we trying to divide by 0 and why are passing a null Sprocket? This is something that could indicate a large problem at the root level. Try/Catch/Ignoring the problem is probably not the right call. Now, that kind of depends based on the architecture of the system. Obviously a web server or an MMO server should not blow up. However, that still doesn&#039;t mean it&#039;s okay to sweep the error under the rug. That information needs to be surfaced. I guess the code sample was a little too vague to convey the message. You&#039;ll notice that if SomeRiskyOperation doesn&#039;t complete, we totally return true as if we did everything we needed, because maybe when someone was working on this code they got an exception that COULD be ignored. Now the Exception is that we can&#039;t connect to the database and nothing is working. It&#039;s still an SQLException, and maybe the third party you&#039;re using only provides one type of named Exception. (You&#039;ll notice I didn&#039;t even use System.Exception in the example. If you ever sweep that one under the rug...)

If you know you&#039;re going to pass an Invalid Argument to a function half the time, why bother calling that function in the first place? Granted, code that throws an Exception should leave an object untouched instead of in a heinous state, but why do all that work?]]></description>
			<content:encoded><![CDATA[<p>Oh, Rob. I think we agree on different levels.</p>
<p>I&#8217;m not saying exceptions are fundamentally flawed. I&#8217;m saying reserve them for when things are absolutely out of your control, or for where you know 100% (not 99) that you can safely move past an exception without a problem. Those are what I think you can consider &#8220;exceptional.&#8221; </p>
<p>I am fully in agreement when you say things like: &#8220;Rewrite that code without exceptions and it doesn’t get any better. It may get faster, but the speed issue isn’t exceptions’ fault either- that is still just faulty code.&#8221; &#8220;Well, no one can say either- which is why null should be an invalid argument to Frob and Frob should throw an exception.&#8221; However, I agree because I think try / catch usually gets added to the mix in the wrong occasions only to mask this.</p>
<p>The real questions here are why are we trying to divide by 0 and why are passing a null Sprocket? This is something that could indicate a large problem at the root level. Try/Catch/Ignoring the problem is probably not the right call. Now, that kind of depends based on the architecture of the system. Obviously a web server or an MMO server should not blow up. However, that still doesn&#8217;t mean it&#8217;s okay to sweep the error under the rug. That information needs to be surfaced. I guess the code sample was a little too vague to convey the message. You&#8217;ll notice that if SomeRiskyOperation doesn&#8217;t complete, we totally return true as if we did everything we needed, because maybe when someone was working on this code they got an exception that COULD be ignored. Now the Exception is that we can&#8217;t connect to the database and nothing is working. It&#8217;s still an SQLException, and maybe the third party you&#8217;re using only provides one type of named Exception. (You&#8217;ll notice I didn&#8217;t even use System.Exception in the example. If you ever sweep that one under the rug&#8230;)</p>
<p>If you know you&#8217;re going to pass an Invalid Argument to a function half the time, why bother calling that function in the first place? Granted, code that throws an Exception should leave an object untouched instead of in a heinous state, but why do all that work?</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
