<?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: Using ReSharper, I&#8217;ve Always Wondered Why They Had the &#8220;Invert if&#8221; refactor</title>
	<atom:link href="http://peterkellner.net/2009/10/18/refactor-csharp-if-resharper/feed/" rel="self" type="application/rss+xml" />
	<link>http://peterkellner.net/2009/10/18/refactor-csharp-if-resharper/</link>
	<description>Microsoft Focussed, JavaScript (ExtJS, SenchaTouch &#38; Windows 8 Metro)</description>
	<lastBuildDate>Wed, 08 Feb 2012 21:38:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: CB</title>
		<link>http://peterkellner.net/2009/10/18/refactor-csharp-if-resharper/comment-page-1/#comment-25586</link>
		<dc:creator>CB</dc:creator>
		<pubDate>Wed, 11 Nov 2009 05:16:12 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2009/10/18/refactor-csharp-if-resharper/#comment-25586</guid>
		<description>[...] my last post, I found a use for inverting if statements.&#160; That is, I postulated that it is better to have [...]</description>
		<content:encoded><![CDATA[<p>[...] my last post, I found a use for inverting if statements.&#160; That is, I postulated that it is better to have [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Batum</title>
		<link>http://peterkellner.net/2009/10/18/refactor-csharp-if-resharper/comment-page-1/#comment-25575</link>
		<dc:creator>Paul Batum</dc:creator>
		<pubDate>Tue, 10 Nov 2009 02:17:47 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2009/10/18/refactor-csharp-if-resharper/#comment-25575</guid>
		<description>@DavidKemp Agreed!

The total give away is the comment:
// Linear interpolation from top of range to bottom for speed

Why write that comment when you can just make a 
DoTopToBottomLinearInterpolation() method?</description>
		<content:encoded><![CDATA[<p>@DavidKemp Agreed!</p>
<p>The total give away is the comment:<br />
// Linear interpolation from top of range to bottom for speed</p>
<p>Why write that comment when you can just make a<br />
DoTopToBottomLinearInterpolation() method?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Kemp</title>
		<link>http://peterkellner.net/2009/10/18/refactor-csharp-if-resharper/comment-page-1/#comment-25490</link>
		<dc:creator>David Kemp</dc:creator>
		<pubDate>Wed, 21 Oct 2009 08:29:03 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2009/10/18/refactor-csharp-if-resharper/#comment-25490</guid>
		<description>I go with Frederico. 
The if(doDeficitCalc) throw new ... is a guard statement, and really shouldn&#039;t have an else. 
Also, that second bit should probably be refactored to another function :D</description>
		<content:encoded><![CDATA[<p>I go with Frederico.<br />
The if(doDeficitCalc) throw new &#8230; is a guard statement, and really shouldn&#8217;t have an else.<br />
Also, that second bit should probably be refactored to another function <img src='http://peterkellner.net/wp/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: To Brace or not to Brace in C# ifs and other Constructs &#124; PeterKellner.net</title>
		<link>http://peterkellner.net/2009/10/18/refactor-csharp-if-resharper/comment-page-1/#comment-25481</link>
		<dc:creator>To Brace or not to Brace in C# ifs and other Constructs &#124; PeterKellner.net</dc:creator>
		<pubDate>Mon, 19 Oct 2009 15:25:14 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2009/10/18/refactor-csharp-if-resharper/#comment-25481</guid>
		<description>[...] my last post, I found a use for inverting if statements.&#160; That is, I postulated that it is better to have [...]</description>
		<content:encoded><![CDATA[<p>[...] my last post, I found a use for inverting if statements.&#160; That is, I postulated that it is better to have [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://peterkellner.net/2009/10/18/refactor-csharp-if-resharper/comment-page-1/#comment-25480</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Mon, 19 Oct 2009 14:44:47 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2009/10/18/refactor-csharp-if-resharper/#comment-25480</guid>
		<description>I totally get Frederico and Jeremy&#039;s points.  My feeling in general is, for maintainability, I like to be as explicit as possible.  By having the else at the bottom of an if makes it 100% clear.  Otherwise, someone might add something to the bottom of the method and not realize it was only meant to be executed when the if failed (which might not be obvious from the logic like it is in my example).  Kind of feels like the whether to use {} debate which maybe I will post next.</description>
		<content:encoded><![CDATA[<p>I totally get Frederico and Jeremy&#8217;s points.  My feeling in general is, for maintainability, I like to be as explicit as possible.  By having the else at the bottom of an if makes it 100% clear.  Otherwise, someone might add something to the bottom of the method and not realize it was only meant to be executed when the if failed (which might not be obvious from the logic like it is in my example).  Kind of feels like the whether to use {} debate which maybe I will post next.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Gray</title>
		<link>http://peterkellner.net/2009/10/18/refactor-csharp-if-resharper/comment-page-1/#comment-25479</link>
		<dc:creator>Jeremy Gray</dc:creator>
		<pubDate>Mon, 19 Oct 2009 14:25:03 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2009/10/18/refactor-csharp-if-resharper/#comment-25479</guid>
		<description>I&#039;m with Frederico. Redundant Else for the win! The invert refactoring is useful in a number of cases, one being to allow you to apply redundant else when what was the else block always returns, or when the else block is much shorter than the if block (which, when swapped to be first, reads more easily), or when the if condition is more easily read when inverted (due to negations, ands versus ors, etc.), and so on. Lotsa great uses out there. :)</description>
		<content:encoded><![CDATA[<p>I&#8217;m with Frederico. Redundant Else for the win! The invert refactoring is useful in a number of cases, one being to allow you to apply redundant else when what was the else block always returns, or when the else block is much shorter than the if block (which, when swapped to be first, reads more easily), or when the if condition is more easily read when inverted (due to negations, ands versus ors, etc.), and so on. Lotsa great uses out there. <img src='http://peterkellner.net/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frederico Pinto</title>
		<link>http://peterkellner.net/2009/10/18/refactor-csharp-if-resharper/comment-page-1/#comment-25475</link>
		<dc:creator>Frederico Pinto</dc:creator>
		<pubDate>Sun, 18 Oct 2009 20:49:25 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2009/10/18/refactor-csharp-if-resharper/#comment-25475</guid>
		<description>I would follow the first warning (redundant if) because it would reduce nesting... when execution enters the &quot;if&quot; the routine will return on the throw anyway.

if(!doDeficitCalc)
    throw new...

double x1...</description>
		<content:encoded><![CDATA[<p>I would follow the first warning (redundant if) because it would reduce nesting&#8230; when execution enters the &#8220;if&#8221; the routine will return on the throw anyway.</p>
<p>if(!doDeficitCalc)<br />
    throw new&#8230;</p>
<p>double x1&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 3/28 queries in 0.175 seconds using disk

Served from: peterkellner.net @ 2012-02-10 05:53:07 -->
