<?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: To if-else-if or if-if, that is the question</title>
	<atom:link href="http://shape-of-code.coding-guidelines.com/2009/08/21/108/feed/" rel="self" type="application/rss+xml" />
	<link>http://shape-of-code.coding-guidelines.com/2009/08/21/108/</link>
	<description></description>
	<lastBuildDate>Sun, 12 Feb 2012 22:01:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: The Shape of Code &#187; Estimating variance when measuring source</title>
		<link>http://shape-of-code.coding-guidelines.com/2009/08/21/108/comment-page-1/#comment-664</link>
		<dc:creator>The Shape of Code &#187; Estimating variance when measuring source</dc:creator>
		<pubDate>Thu, 08 Oct 2009 19:25:26 +0000</pubDate>
		<guid isPermaLink="false">http://shape-of-code.coding-guidelines.com/?p=108#comment-664</guid>
		<description>[...] the percentage of equality tests that occur in the controlling expressions of if-if/if-else-if sequences and switch statements we get the [...]</description>
		<content:encoded><![CDATA[<p>[...] the percentage of equality tests that occur in the controlling expressions of if-if/if-else-if sequences and switch statements we get the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Shape of Code &#187; Using Coccinelle to match if sequences</title>
		<link>http://shape-of-code.coding-guidelines.com/2009/08/21/108/comment-page-1/#comment-617</link>
		<dc:creator>The Shape of Code &#187; Using Coccinelle to match if sequences</dc:creator>
		<pubDate>Mon, 31 Aug 2009 16:06:06 +0000</pubDate>
		<guid isPermaLink="false">http://shape-of-code.coding-guidelines.com/?p=108#comment-617</guid>
		<description>[...] have been using Coccinelle to obtain measurements of various properties of C if and switch statements. It is rare to find a tool that does exactly what is desired but it is often [...]</description>
		<content:encoded><![CDATA[<p>[...] have been using Coccinelle to obtain measurements of various properties of C if and switch statements. It is rare to find a tool that does exactly what is desired but it is often [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derek-Jones</title>
		<link>http://shape-of-code.coding-guidelines.com/2009/08/21/108/comment-page-1/#comment-614</link>
		<dc:creator>Derek-Jones</dc:creator>
		<pubDate>Mon, 24 Aug 2009 15:16:34 +0000</pubDate>
		<guid isPermaLink="false">http://shape-of-code.coding-guidelines.com/?p=108#comment-614</guid>
		<description>More tests appear to be needed at runtime for the if-if usage.  I say &#039;appear&#039; because after gcc&#039;s impressive performance on &lt;a href=&quot;http://shape-of-code.coding-guidelines.com/2009/06/searching-for-the-source-line-implementing-3n1/&quot; rel=&quot;nofollow&quot;&gt;3n+1&lt;/a&gt; I thought it might spot when if-if could be implemented as if-else-if; a quick check shows that with -O2 optimization gcc does indeed implement this transformation.</description>
		<content:encoded><![CDATA[<p>More tests appear to be needed at runtime for the if-if usage.  I say &#8216;appear&#8217; because after gcc&#8217;s impressive performance on <a href="http://shape-of-code.coding-guidelines.com/2009/06/searching-for-the-source-line-implementing-3n1/" rel="nofollow">3n+1</a> I thought it might spot when if-if could be implemented as if-else-if; a quick check shows that with -O2 optimization gcc does indeed implement this transformation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Safer Code</title>
		<link>http://shape-of-code.coding-guidelines.com/2009/08/21/108/comment-page-1/#comment-613</link>
		<dc:creator>Safer Code</dc:creator>
		<pubDate>Mon, 24 Aug 2009 05:08:31 +0000</pubDate>
		<guid isPermaLink="false">http://shape-of-code.coding-guidelines.com/?p=108#comment-613</guid>
		<description>Hey Derek
I have a doubt when you say that there is no obvious cost or benefit...If the control variable is being changed then obviously we would have to go for the 2nd form because the first wouldn&#039;t cover all cases and if we assume that the variable is not being changed then I agree there might not be any difference in worst case scenario (last condition holds true) but wouldn&#039;t the 2nd form cause penalties in best case scenario (first condition holds true) as many more tests would be done in 2nd case even though we don&#039;t need to check anymore..</description>
		<content:encoded><![CDATA[<p>Hey Derek<br />
I have a doubt when you say that there is no obvious cost or benefit&#8230;If the control variable is being changed then obviously we would have to go for the 2nd form because the first wouldn&#8217;t cover all cases and if we assume that the variable is not being changed then I agree there might not be any difference in worst case scenario (last condition holds true) but wouldn&#8217;t the 2nd form cause penalties in best case scenario (first condition holds true) as many more tests would be done in 2nd case even though we don&#8217;t need to check anymore..</p>
]]></content:encoded>
	</item>
</channel>
</rss>

