<?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: Exceptions are for Exceptions</title>
	<atom:link href="http://www.csharp411.com/exceptions-are-for-exceptions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csharp411.com/exceptions-are-for-exceptions/</link>
	<description>C# Information, Code, Tips and News</description>
	<lastBuildDate>Sat, 13 Mar 2010 00:13:45 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: timm</title>
		<link>http://www.csharp411.com/exceptions-are-for-exceptions/comment-page-1/#comment-5252</link>
		<dc:creator>timm</dc:creator>
		<pubDate>Fri, 07 Aug 2009 12:51:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/exceptions-are-for-exceptions/#comment-5252</guid>
		<description>Very funny, guys.  Apparently you did not read the rest of my article.  The very next paragraph says:

&quot;In my ad-hoc testing using C#, I discovered that there is some truth to both of the statements above.  Outside the debugger, throwing exceptions was on average 6 times slower than passing arguments.  But inside the debugger, throwing exceptions was on average 65 times slower than passing arguments.  This was a looping test throwing an exception only one level deep, so real-life performance of exceptions multiple levels deep and scattered across a program would be even slower.&quot;

http://www.devtopics.com/exceptions-are-for-exceptions</description>
		<content:encoded><![CDATA[<p>Very funny, guys.  Apparently you did not read the rest of my article.  The very next paragraph says:</p>
<p>"In my ad-hoc testing using C#, I discovered that there is some truth to both of the statements above.  Outside the debugger, throwing exceptions was on average 6 times slower than passing arguments.  But inside the debugger, throwing exceptions was on average 65 times slower than passing arguments.  This was a looping test throwing an exception only one level deep, so real-life performance of exceptions multiple levels deep and scattered across a program would be even slower."</p>
<p><a href="http://www.devtopics.com/exceptions-are-for-exceptions" rel="nofollow">http://www.devtopics.com/exceptions-are-for-exceptions</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: C# Fan</title>
		<link>http://www.csharp411.com/exceptions-are-for-exceptions/comment-page-1/#comment-5251</link>
		<dc:creator>C# Fan</dc:creator>
		<pubDate>Fri, 07 Aug 2009 12:38:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/exceptions-are-for-exceptions/#comment-5251</guid>
		<description>@Dag: I think if you decide to comment on a blog about a topic it&#039;s reasonable to expect you to know it well (research it to achieve this if required), not just say &quot;involves considerable overhead&quot;.</description>
		<content:encoded><![CDATA[<p>@Dag: I think if you decide to comment on a blog about a topic it's reasonable to expect you to know it well (research it to achieve this if required), not just say "involves considerable overhead".</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dag Johansen</title>
		<link>http://www.csharp411.com/exceptions-are-for-exceptions/comment-page-1/#comment-5250</link>
		<dc:creator>Dag Johansen</dc:creator>
		<pubDate>Fri, 07 Aug 2009 11:53:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/exceptions-are-for-exceptions/#comment-5250</guid>
		<description>I think if you decide to blog about a topic it&#039;s reasonable to expect you to know it well (research it to achieve this if required), not just say &quot;some claim it&#039;s slow, some say it&#039;s not&quot;. 

If you think about what actually happens at the low level, it&#039;s quite obvious that throwing exceptions involves considerable overhead - especially if the catch is many stack frames below the one throwing one. However, proctecting code in a try-block doesn&#039;t cost anything as long as exceptions don&#039;t occur. So basically we should catch them when we can&#039;t handle them, and otherwise not.

Many programmers write code with lots of catch blocks and few if any throw statements, and then fail to actually *handle* the exceptions in the catch blocks. I&#039;ve even come across quite a few empty catch blocks, which of course serves no purpose other than hide the fact that things went haywire, causing other things to go haywire elsewhere and making it exponentially more difficult to figure out what happened - or, in especially unlucky cases, in no errors the system is aware of at all, but rather corrupted data and false results. It&#039; great for financial reporting applications...</description>
		<content:encoded><![CDATA[<p>I think if you decide to blog about a topic it's reasonable to expect you to know it well (research it to achieve this if required), not just say "some claim it's slow, some say it's not". </p>
<p>If you think about what actually happens at the low level, it's quite obvious that throwing exceptions involves considerable overhead &#8211; especially if the catch is many stack frames below the one throwing one. However, proctecting code in a try-block doesn't cost anything as long as exceptions don't occur. So basically we should catch them when we can't handle them, and otherwise not.</p>
<p>Many programmers write code with lots of catch blocks and few if any throw statements, and then fail to actually *handle* the exceptions in the catch blocks. I've even come across quite a few empty catch blocks, which of course serves no purpose other than hide the fact that things went haywire, causing other things to go haywire elsewhere and making it exponentially more difficult to figure out what happened &#8211; or, in especially unlucky cases, in no errors the system is aware of at all, but rather corrupted data and false results. It' great for financial reporting applications&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: phenry</title>
		<link>http://www.csharp411.com/exceptions-are-for-exceptions/comment-page-1/#comment-4939</link>
		<dc:creator>phenry</dc:creator>
		<pubDate>Fri, 29 May 2009 15:47:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/exceptions-are-for-exceptions/#comment-4939</guid>
		<description>I&#039;ve done some further investigations into this.  I think the heart of the issue is error checking vs exception handling, IMHO that is.

I hope you take a gander and add your thoughts.

http://www.pchenry.com/Home/tabid/36/EntryID/123/Default.aspx</description>
		<content:encoded><![CDATA[<p>I've done some further investigations into this.  I think the heart of the issue is error checking vs exception handling, IMHO that is.</p>
<p>I hope you take a gander and add your thoughts.</p>
<p><a href="http://www.pchenry.com/Home/tabid/36/EntryID/123/Default.aspx" rel="nofollow">http://www.pchenry.com/Home/tabid/36/EntryID/123/Default.aspx</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
