<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Intrepid Blog &#187; assertation</title>
	<atom:link href="http://blog.affien.com/archives/tag/assertation/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.affien.com</link>
	<description>A few thoughts</description>
	<lastBuildDate>Mon, 23 Jan 2012 08:47:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using exception or assertation</title>
		<link>http://blog.affien.com/archives/2005/02/28/using-exception-or-assertation/</link>
		<comments>http://blog.affien.com/archives/2005/02/28/using-exception-or-assertation/#comments</comments>
		<pubDate>Mon, 28 Feb 2005 17:54:03 +0000</pubDate>
		<dc:creator>Bas Westerbaan</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[assertation]]></category>
		<category><![CDATA[exceptions]]></category>

		<guid isPermaLink="false">http://blog.w-nz.com/archives/2005/02/28/using-exception-or-assertation/</guid>
		<description><![CDATA[People tend to mix up the intended use of exceptions an [...]]]></description>
			<content:encoded><![CDATA[<p>People tend to mix up the intended use of exceptions and assertations.</p>
<h3>Assertations</h3>
<p>Most assertation implementations will show up a form and most of them allow you to <em>ignore</em> the assertation. I once was using a program which even asked me whether I wanted to ignore that assertation in the future.</p>
<p>Using asserations as normal errors is wrong. Assertations aren&#8217;t meant to be errors, neither exceptions.</p>
<p>Using assertations (as you should) is to make sure that the conditions that <em>should</em> be right are right, if they aren&#8217;t right you will know and you know you made an error and not the program or the user.</p>
<p>A seemingly ridiculous example is the following assertation:</p>
<p><code>ASSERT(1 + 1 == 2)</code></p>
<p>If a programmer uses the assumption that 1 + 1 is 2 and isn&#8217;t sure about this he would use an assertation to be notified when he was wrong or missed something.</p>
<h3>Exceptions</h3>
<p>Most people treat exceptions as failures of a piece of program. And some programmers don&#8217;t tend to clean up stuff before they throw an exception for they just think that noone wants to do anything anymore, for an exception, they think, is fatal.</p>
<p>Exception aren&#8217;t fatal. Exceptions aren&#8217;t errors. <strong>Exceptions occur</strong>, for they are just as the word says exceptions. You just got to handle any exception that might occur. An exception becomes fatal when this isn&#8217;t handled for it is either totaly unexpected or just unhandable, where in both cases letting the exception stay unhandled is a better alternative than using an assertation.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affien.com/archives/2005/02/28/using-exception-or-assertation/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

