<?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: Perl Style:  The If / Else Statement</title>
	<atom:link href="http://elliottback.com/wp/perl-style-the-if-else-statement/feed/" rel="self" type="application/rss+xml" />
	<link>http://elliottback.com/wp/perl-style-the-if-else-statement/</link>
	<description>Internet &#38; Technology</description>
	<lastBuildDate>Wed, 08 Feb 2012 10:01:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Demiurg</title>
		<link>http://elliottback.com/wp/perl-style-the-if-else-statement/#comment-2199596</link>
		<dc:creator>Demiurg</dc:creator>
		<pubDate>Tue, 23 Aug 2011 09:11:38 +0000</pubDate>
		<guid isPermaLink="false">http://elliottback.com/wp/archives/2006/09/06/perl-style-the-if-else-statement/#comment-2199596</guid>
		<description>You must use blank line before &quot;if&quot;</description>
		<content:encoded><![CDATA[<p>You must use blank line before &#8220;if&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: doc</title>
		<link>http://elliottback.com/wp/perl-style-the-if-else-statement/#comment-2196924</link>
		<dc:creator>doc</dc:creator>
		<pubDate>Sun, 19 Dec 2010 19:51:07 +0000</pubDate>
		<guid isPermaLink="false">http://elliottback.com/wp/archives/2006/09/06/perl-style-the-if-else-statement/#comment-2196924</guid>
		<description>an uncuddled else looks like a &quot;new statement&quot;, a cuddled else implies that the else3 is part of the prior statement... which it is.  perl style guides are just wrong about this... and it actually really bugs me.
&lt;code&gt;
# easy to see just 2 statements
if (...) {
} elseif (...) {
}
if (...) {
}

# harder to see only 2 statements

if (...) {
} 
elsif (...) {
}
if (...) {
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>an uncuddled else looks like a &#8220;new statement&#8221;, a cuddled else implies that the else3 is part of the prior statement&#8230; which it is.  perl style guides are just wrong about this&#8230; and it actually really bugs me.<br />
<code><br />
# easy to see just 2 statements<br />
if (...) {<br />
} elseif (...) {<br />
}<br />
if (...) {<br />
}</p>
<p># harder to see only 2 statements</p>
<p>if (...) {<br />
}<br />
elsif (...) {<br />
}<br />
if (...) {<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SR</title>
		<link>http://elliottback.com/wp/perl-style-the-if-else-statement/#comment-2190279</link>
		<dc:creator>SR</dc:creator>
		<pubDate>Wed, 23 Dec 2009 18:30:10 +0000</pubDate>
		<guid isPermaLink="false">http://elliottback.com/wp/archives/2006/09/06/perl-style-the-if-else-statement/#comment-2190279</guid>
		<description>@Robin:

I cuddle my elses as well, and I don&#039;t think it hurts readability at all (actually, I think it helps to have all elses and elsifs preceeded by a close brace) but there *is* something you can put between an if and an else:  comments.

### Do such and such in some case
if ($foo eq $bar) {
    ...
}
### Do something else in another case
elsif ($bar eq $baz) {
    ...
}
### Catch other cases
else {
    ...
}</description>
		<content:encoded><![CDATA[<p>@Robin:</p>
<p>I cuddle my elses as well, and I don&#8217;t think it hurts readability at all (actually, I think it helps to have all elses and elsifs preceeded by a close brace) but there *is* something you can put between an if and an else:  comments.</p>
<p>### Do such and such in some case<br />
if ($foo eq $bar) {<br />
    &#8230;<br />
}<br />
### Do something else in another case<br />
elsif ($bar eq $baz) {<br />
    &#8230;<br />
}<br />
### Catch other cases<br />
else {<br />
    &#8230;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LordOfTheDance</title>
		<link>http://elliottback.com/wp/perl-style-the-if-else-statement/#comment-2189352</link>
		<dc:creator>LordOfTheDance</dc:creator>
		<pubDate>Thu, 15 Oct 2009 12:08:19 +0000</pubDate>
		<guid isPermaLink="false">http://elliottback.com/wp/archives/2006/09/06/perl-style-the-if-else-statement/#comment-2189352</guid>
		<description>I think there are more important things to worry about, you anal twats.</description>
		<content:encoded><![CDATA[<p>I think there are more important things to worry about, you anal twats.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robin</title>
		<link>http://elliottback.com/wp/perl-style-the-if-else-statement/#comment-2187900</link>
		<dc:creator>Robin</dc:creator>
		<pubDate>Fri, 24 Jul 2009 16:40:28 +0000</pubDate>
		<guid isPermaLink="false">http://elliottback.com/wp/archives/2006/09/06/perl-style-the-if-else-statement/#comment-2187900</guid>
		<description>I much prefer cuddled.

I don&#039;t think that readability is hurt one bit, it&#039;s easy to read:

} else {

And it makes more sense to me. An &quot;else&quot; can&#039;t exist without an &quot;if&quot; - and you can&#039;t put anything in between the two.

If you don&#039;t cuddle the else, it looks like a statement in its own right, meaning you could do something like:

if(something) {
}
die &quot;here&quot;;
else {
}

As you all know, this is syntactically incorrect. Hence why &quot;} else {&quot; makes more sense.</description>
		<content:encoded><![CDATA[<p>I much prefer cuddled.</p>
<p>I don&#8217;t think that readability is hurt one bit, it&#8217;s easy to read:</p>
<p>} else {</p>
<p>And it makes more sense to me. An &#8220;else&#8221; can&#8217;t exist without an &#8220;if&#8221; &#8211; and you can&#8217;t put anything in between the two.</p>
<p>If you don&#8217;t cuddle the else, it looks like a statement in its own right, meaning you could do something like:</p>
<p>if(something) {<br />
}<br />
die &#8220;here&#8221;;<br />
else {<br />
}</p>
<p>As you all know, this is syntactically incorrect. Hence why &#8220;} else {&#8221; makes more sense.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic page generated in 0.157 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-10 04:39:25 -->

