<?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: My rules of thumb for developers: use less indentation</title>
	<atom:link href="http://rc3.org/2008/05/11/my-rules-of-thumb-for-developers-use-less-indentation/feed/" rel="self" type="application/rss+xml" />
	<link>http://rc3.org/2008/05/11/my-rules-of-thumb-for-developers-use-less-indentation/</link>
	<description>Strong opinions weakly held</description>
	<lastBuildDate>Fri, 10 Feb 2012 14:59:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: bryan</title>
		<link>http://rc3.org/2008/05/11/my-rules-of-thumb-for-developers-use-less-indentation/comment-page-1/#comment-2656</link>
		<dc:creator>bryan</dc:creator>
		<pubDate>Mon, 12 May 2008 21:03:23 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/?p=8230#comment-2656</guid>
		<description>&lt;p&gt;&quot;elsif,&quot; &quot;else if&quot; and their ilk are enemies of readable code. Also, as McConnell states in CC, long functions are enemies of readability.&lt;/p&gt;

&lt;p&gt;A few comments go a long way&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;if (something &gt; 10) {
  if (something &lt; 100) {
    // Do something
  } else {
    if (something &gt; 150) {
      // Do something else
    } else {
      return false;
    } // &gt; 150
  } // &lt; 100
} else {
  while (something &lt; 10) {
    // Do some other stuff
  }
} // &gt; 10
&lt;/code&gt;&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>&#8220;elsif,&#8221; &#8220;else if&#8221; and their ilk are enemies of readable code. Also, as McConnell states in CC, long functions are enemies of readability.</p>

<p>A few comments go a long way</p>

<pre><code>if (something &gt; 10) {
  if (something &lt; 100) {
    // Do something
  } else {
    if (something &gt; 150) {
      // Do something else
    } else {
      return false;
    } // &gt; 150
  } // &lt; 100
} else {
  while (something &lt; 10) {
    // Do some other stuff
  }
} // &gt; 10
</code></pre>]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Drimmie</title>
		<link>http://rc3.org/2008/05/11/my-rules-of-thumb-for-developers-use-less-indentation/comment-page-1/#comment-2651</link>
		<dc:creator>Rob Drimmie</dc:creator>
		<pubDate>Mon, 12 May 2008 13:36:09 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/?p=8230#comment-2651</guid>
		<description>&lt;p&gt;I am just chiming in with my agreement.&lt;/p&gt;

&lt;p&gt;Some support for this style is offered by Steve McConnell in Code Complete.   Section 17.1 talks about return statements, and a key point is &quot;Use a return when it enhances readability&quot;.&lt;/p&gt;

&lt;p&gt;The downside McConnell identifies is that it can be hard to identify where a function exits if there are too many returns, but that&#039;s an issue that is avoided more by following other principles of good style.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I am just chiming in with my agreement.</p>

<p>Some support for this style is offered by Steve McConnell in Code Complete.   Section 17.1 talks about return statements, and a key point is &#8220;Use a return when it enhances readability&#8221;.</p>

<p>The downside McConnell identifies is that it can be hard to identify where a function exits if there are too many returns, but that&#8217;s an issue that is avoided more by following other principles of good style.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Smith</title>
		<link>http://rc3.org/2008/05/11/my-rules-of-thumb-for-developers-use-less-indentation/comment-page-1/#comment-2650</link>
		<dc:creator>Dave Smith</dc:creator>
		<pubDate>Mon, 12 May 2008 06:09:31 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/?p=8230#comment-2650</guid>
		<description>&lt;p&gt;You&#039;re describing what is elsewhere known as a &quot;guard clause&quot;. It&#039;s a fine way to handle all of the &quot;early out&quot; test that would otherwise clutter up a method with extra nesting.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>You&#8217;re describing what is elsewhere known as a &#8220;guard clause&#8221;. It&#8217;s a fine way to handle all of the &#8220;early out&#8221; test that would otherwise clutter up a method with extra nesting.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Rafe</title>
		<link>http://rc3.org/2008/05/11/my-rules-of-thumb-for-developers-use-less-indentation/comment-page-1/#comment-2649</link>
		<dc:creator>Rafe</dc:creator>
		<pubDate>Mon, 12 May 2008 03:33:30 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/?p=8230#comment-2649</guid>
		<description>&lt;p&gt;Yeah, I use &lt;code&gt;continue&lt;/code&gt; a lot.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Yeah, I use <code>continue</code> a lot.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Quillian</title>
		<link>http://rc3.org/2008/05/11/my-rules-of-thumb-for-developers-use-less-indentation/comment-page-1/#comment-2648</link>
		<dc:creator>Quillian</dc:creator>
		<pubDate>Mon, 12 May 2008 03:19:16 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/?p=8230#comment-2648</guid>
		<description>&lt;p&gt;I normally use a default return value at the end of a code function, so I&#039;d do like(in a pseudocode):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;func f(string s){
   if(s == &quot;something&quot;){
    //Do something
      if( s.strlen() == 10){
    return true;
 }
  }
  return false;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In C I see people who like goto to do cleanup like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;int f(char *s){
  int retv = 0;
  if(strcmp(s,&quot;something&quot;) != 0){
    goto f_end;
  }
  //Do something
  if(strlen(s) == 10){
    retv =1;
  }
f_end:
  //Logging, debugging messages, etc.
  return retv;
}
&lt;/code&gt;&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>I normally use a default return value at the end of a code function, so I&#8217;d do like(in a pseudocode):</p>

<pre><code>func f(string s){
   if(s == "something"){
    //Do something
      if( s.strlen() == 10){
    return true;
 }
  }
  return false;
}
</code></pre>

<p>In C I see people who like goto to do cleanup like:</p>

<pre><code>int f(char *s){
  int retv = 0;
  if(strcmp(s,"something") != 0){
    goto f_end;
  }
  //Do something
  if(strlen(s) == 10){
    retv =1;
  }
f_end:
  //Logging, debugging messages, etc.
  return retv;
}
</code></pre>]]></content:encoded>
	</item>
	<item>
		<title>By: Leo Petr</title>
		<link>http://rc3.org/2008/05/11/my-rules-of-thumb-for-developers-use-less-indentation/comment-page-1/#comment-2647</link>
		<dc:creator>Leo Petr</dc:creator>
		<pubDate>Mon, 12 May 2008 02:25:57 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/?p=8230#comment-2647</guid>
		<description>&lt;p&gt;In loops, you would use &#039;break&#039; and &#039;continue&#039; to achieve a similar de-nesting. &#039;Continue&#039; is especially underused.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>In loops, you would use &#8216;break&#8217; and &#8216;continue&#8217; to achieve a similar de-nesting. &#8216;Continue&#8217; is especially underused.</p>]]></content:encoded>
	</item>
</channel>
</rss>

