<?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: Bracket Style and Indenting Code</title>
	<atom:link href="http://www.catchmyfame.com/2007/12/18/bracket-style-and-indenting-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.catchmyfame.com/2007/12/18/bracket-style-and-indenting-code/</link>
	<description>A web designoper&#039;s journal</description>
	<lastBuildDate>Sat, 04 Feb 2012 02:01:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Jon</title>
		<link>http://www.catchmyfame.com/2007/12/18/bracket-style-and-indenting-code/comment-page-1/#comment-10608</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Thu, 17 Feb 2011 18:04:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.catchmyfame.com/2007/12/18/bracket-style-and-indenting-code/#comment-10608</guid>
		<description>I am fairly new to php and the tutorials I&#039;ve viewed online sometimes leave me confused. It&#039;s good to know this. I very much like your style of coding. I thought perhaps there were &#039;standards&#039; or &#039;rules&#039; to coding and I strayed from them my code wouldn&#039;t work properly. Anyway, thanks for the time to post this.</description>
		<content:encoded><![CDATA[<p>I am fairly new to php and the tutorials I&#8217;ve viewed online sometimes leave me confused. It&#8217;s good to know this. I very much like your style of coding. I thought perhaps there were &#8216;standards&#8217; or &#8216;rules&#8217; to coding and I strayed from them my code wouldn&#8217;t work properly. Anyway, thanks for the time to post this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jon</title>
		<link>http://www.catchmyfame.com/2007/12/18/bracket-style-and-indenting-code/comment-page-1/#comment-10515</link>
		<dc:creator>jon</dc:creator>
		<pubDate>Thu, 27 Jan 2011 20:45:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.catchmyfame.com/2007/12/18/bracket-style-and-indenting-code/#comment-10515</guid>
		<description>lolz first style there is for nabz who just want more lines of code)) the real style is like this:
for (int x = 0;x &lt; 10;x++) {
  if (nab[x]) {
    blabla();
  } else {
    fgdgdg();
  }
}

more readabel, looks cooler also much more compresed</description>
		<content:encoded><![CDATA[<p>lolz first style there is for nabz who just want more lines of code)) the real style is like this:<br />
for (int x = 0;x &lt; 10;x++) {<br />
  if (nab[x]) {<br />
    blabla();<br />
  } else {<br />
    fgdgdg();<br />
  }<br />
}</p>
<p>more readabel, looks cooler also much more compresed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas</title>
		<link>http://www.catchmyfame.com/2007/12/18/bracket-style-and-indenting-code/comment-page-1/#comment-8771</link>
		<dc:creator>Thomas</dc:creator>
		<pubDate>Thu, 28 Oct 2010 10:18:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.catchmyfame.com/2007/12/18/bracket-style-and-indenting-code/#comment-8771</guid>
		<description>Or even even shorter :D

return (hours &lt; 24 &amp;&amp; minutes &lt; 60 &amp;&amp; seconds &lt; 60) &amp;&amp; !(hours % 2)</description>
		<content:encoded><![CDATA[<p>Or even even shorter :D</p>
<p>return (hours &lt; 24 &amp;&amp; minutes &lt; 60 &amp;&amp; seconds &lt; 60) &amp;&amp; !(hours % 2)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vincent McGreevy</title>
		<link>http://www.catchmyfame.com/2007/12/18/bracket-style-and-indenting-code/comment-page-1/#comment-5635</link>
		<dc:creator>Vincent McGreevy</dc:creator>
		<pubDate>Mon, 25 Jan 2010 16:41:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.catchmyfame.com/2007/12/18/bracket-style-and-indenting-code/#comment-5635</guid>
		<description>or even shorter

if (hours &lt; 24 &amp;&amp; minutes &lt; 60 &amp;&amp; seconds &lt; 60)
{
   if(hours % 2 == 0)
      return true;
   else
       return false;
}</description>
		<content:encoded><![CDATA[<p>or even shorter</p>
<p>if (hours &lt; 24 &amp;&amp; minutes &lt; 60 &amp;&amp; seconds &lt; 60)<br />
{<br />
   if(hours % 2 == 0)<br />
      return true;<br />
   else<br />
       return false;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zeph</title>
		<link>http://www.catchmyfame.com/2007/12/18/bracket-style-and-indenting-code/comment-page-1/#comment-1453</link>
		<dc:creator>Zeph</dc:creator>
		<pubDate>Tue, 07 Jul 2009 00:54:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.catchmyfame.com/2007/12/18/bracket-style-and-indenting-code/#comment-1453</guid>
		<description>It&#039;s about different strokes for different folks.

I have tried a variety of styles, and gravitate back to good old K &amp; R (mostly).   I see the structure immediately via indenting, without needing to count or balance brackets - kind of like Python with closing delimiters.  Additional bracket-only lines just clutter the landscape for me (except the opening of a function definition - there it helps set that apart from control structures).  

Allman style has consistency having all braces on lines by themselves, balanced.  K&amp;R has consistency in closing braces always being at the start of a line, opening at the end, which you can treat as syntactic sugar around the control flow keywords.  Each type of pattern has its positives, which appeal to some more than others.

I disagree somewhat about formerly limited screen space as the only reason for K &amp; R - even if you have 100 lines of code visible on a rotated 24&quot; screen, there is a balance for best visual comprehension between packing code too tightly and too loosely.  For me, K&amp;R works - along with leaving empty lines where ever it makes the code easier to read.

I think it would be interesting to set up one of those eye-focus-point detectors that psychologists like to use, recording how programmers view a program - where their eyes jump as they try to absorb both the structure (forest) and the trees (individual statements and expressions).  I believe that excessive vertical displacement can be a tad slower to comprehend, similar to paragraphs which are too wide.  

Allman might make it easier to find unbalanced braces - but there are editor tools to help with that, and timewise finding unbalanced braces is a small part of program review and modification.

But your milage may vary; I don&#039;t think there&#039;s a universal best style.  I try to follow the existing style when modifying code.</description>
		<content:encoded><![CDATA[<p>It&#8217;s about different strokes for different folks.</p>
<p>I have tried a variety of styles, and gravitate back to good old K &amp; R (mostly).   I see the structure immediately via indenting, without needing to count or balance brackets &#8211; kind of like Python with closing delimiters.  Additional bracket-only lines just clutter the landscape for me (except the opening of a function definition &#8211; there it helps set that apart from control structures).  </p>
<p>Allman style has consistency having all braces on lines by themselves, balanced.  K&amp;R has consistency in closing braces always being at the start of a line, opening at the end, which you can treat as syntactic sugar around the control flow keywords.  Each type of pattern has its positives, which appeal to some more than others.</p>
<p>I disagree somewhat about formerly limited screen space as the only reason for K &amp; R &#8211; even if you have 100 lines of code visible on a rotated 24&#8243; screen, there is a balance for best visual comprehension between packing code too tightly and too loosely.  For me, K&amp;R works &#8211; along with leaving empty lines where ever it makes the code easier to read.</p>
<p>I think it would be interesting to set up one of those eye-focus-point detectors that psychologists like to use, recording how programmers view a program &#8211; where their eyes jump as they try to absorb both the structure (forest) and the trees (individual statements and expressions).  I believe that excessive vertical displacement can be a tad slower to comprehend, similar to paragraphs which are too wide.  </p>
<p>Allman might make it easier to find unbalanced braces &#8211; but there are editor tools to help with that, and timewise finding unbalanced braces is a small part of program review and modification.</p>
<p>But your milage may vary; I don&#8217;t think there&#8217;s a universal best style.  I try to follow the existing style when modifying code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny</title>
		<link>http://www.catchmyfame.com/2007/12/18/bracket-style-and-indenting-code/comment-page-1/#comment-1452</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Sun, 05 Jul 2009 15:46:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.catchmyfame.com/2007/12/18/bracket-style-and-indenting-code/#comment-1452</guid>
		<description>Content inside bracers is 1 tab indented, form just stripped it for anyone wondering.</description>
		<content:encoded><![CDATA[<p>Content inside bracers is 1 tab indented, form just stripped it for anyone wondering.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny</title>
		<link>http://www.catchmyfame.com/2007/12/18/bracket-style-and-indenting-code/comment-page-1/#comment-1451</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Sun, 05 Jul 2009 15:45:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.catchmyfame.com/2007/12/18/bracket-style-and-indenting-code/#comment-1451</guid>
		<description>I like:
if (hours &lt; 24 &amp;&amp; minutes &lt; 60 &amp;&amp; seconds &lt; 60)
{
    return true;
} else
{
    return false;
}
This way I have a straight uninterrupted line of opening and closing brackets I can follow without the else getting in the way. At the end of a brace just look right, if it is empty then its the end of the condition if not there is either the else of elseif. But all this is just personal preference really.</description>
		<content:encoded><![CDATA[<p>I like:<br />
if (hours &lt; 24 &amp;&amp; minutes &lt; 60 &amp;&amp; seconds &lt; 60)<br />
{<br />
    return true;<br />
} else<br />
{<br />
    return false;<br />
}<br />
This way I have a straight uninterrupted line of opening and closing brackets I can follow without the else getting in the way. At the end of a brace just look right, if it is empty then its the end of the condition if not there is either the else of elseif. But all this is just personal preference really.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EllisGL</title>
		<link>http://www.catchmyfame.com/2007/12/18/bracket-style-and-indenting-code/comment-page-1/#comment-623</link>
		<dc:creator>EllisGL</dc:creator>
		<pubDate>Thu, 30 Oct 2008 12:56:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.catchmyfame.com/2007/12/18/bracket-style-and-indenting-code/#comment-623</guid>
		<description>I indent my code that is somewhere in between Allman and GNU styles..</description>
		<content:encoded><![CDATA[<p>I indent my code that is somewhere in between Allman and GNU styles..</p>
]]></content:encoded>
	</item>
</channel>
</rss>

