<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<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">
	<channel>
		<title>冒号论坛 &#187; Tag: error code - Recent Posts</title>
		<link>http://bbs.zhenghui.org/tags/error-code</link>
		<description>冒号论坛 &raquo; Tag: error code - Recent Posts</description>
		<language>en-US</language>
		<pubDate>Wed, 08 Feb 2012 23:25:22 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://bbs.zhenghui.org/search.php</link>
		</textInput>
		<atom:link href="http://bbs.zhenghui.org/rss/tags/error-code" rel="self" type="application/rss+xml" />

		<item>
			<title>hui on "异常机制"</title>
			<link>http://bbs.zhenghui.org/topic/%e5%bc%82%e5%b8%b8%e6%9c%ba%e5%88%b6#post-16</link>
			<pubDate>Wed, 06 Jan 2010 15:05:47 +0000</pubDate>
			<dc:creator>hui</dc:creator>
			<guid isPermaLink="false">16@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;异常机制&#60;em&#62;分离&#60;/em&#62;了（处于低层抽象的）异常发现者与（处于高层抽象的）异常处理者，从这个角度看，异常机制是对SoC原则的一种支持。error code虽然也能达成类似效果，但不像异常机制对那样对异常处理有强制性的要求，因此不如后者更能保证软件可靠性。当然，error code也有可取之处，对于局部错误的处理，它比异常机制更方便、更自然。（Stroustrup在他的著作《The C++ programming Language》中有这么一句话：Exception handling is intended for dealing with nonlocal problems）如果遵循用error code处理局部错误、用异常机制处理非局部错误的原则，那么也可以认为异常机制比error code更加鼓励SoC。&#60;/p&#62;
&#60;p&#62;此外，exception比error code具有更好的抽象性，因为后者通常只是朴素的整数代码。从C过渡到C++的程序员常常throw一个包含错误信息的字符串，而不是一个std::exception对象，便是没有充分利用exception的抽象性。而在Java、C#等语言中，对throw的对象有严格的要求。
&#60;/p&#62;
</description>
		</item>
		<item>
			<title>Todd on "异常机制"</title>
			<link>http://bbs.zhenghui.org/topic/%e5%bc%82%e5%b8%b8%e6%9c%ba%e5%88%b6#post-15</link>
			<pubDate>Wed, 06 Jan 2010 13:22:44 +0000</pubDate>
			<dc:creator>Todd</dc:creator>
			<guid isPermaLink="false">15@http://bbs.zhenghui.org/</guid>
			<description>&#60;p&#62;与C语言的error code机制相比，异常机制是否主要是一种SoC原则的体现呢？
&#60;/p&#62;
</description>
		</item>

	</channel>
</rss>

