<?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: Different Brace Styles in PHP</title>
	<atom:link href="http://austingulati.com/2010/01/different-brace-styles-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://austingulati.com/2010/01/different-brace-styles-in-php/</link>
	<description>Web Developer and Designer</description>
	<lastBuildDate>Fri, 10 Feb 2012 08:24:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: David</title>
		<link>http://austingulati.com/2010/01/different-brace-styles-in-php/comment-page-1/#comment-4676</link>
		<dc:creator>David</dc:creator>
		<pubDate>Thu, 26 May 2011 04:29:08 +0000</pubDate>
		<guid isPermaLink="false">http://gulati.info/?p=1717#comment-4676</guid>
		<description>lol - i guess it didn&#039;t keep my indents :) 

I prefer lining up the &#039;c&#039; of case directly under the braces, whereas Allman would indent the case statements.</description>
		<content:encoded><![CDATA[<p>lol &#8211; i guess it didn&#8217;t keep my indents :) </p>
<p>I prefer lining up the &#8216;c&#8217; of case directly under the braces, whereas Allman would indent the case statements.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://austingulati.com/2010/01/different-brace-styles-in-php/comment-page-1/#comment-4675</link>
		<dc:creator>David</dc:creator>
		<pubDate>Thu, 26 May 2011 04:25:16 +0000</pubDate>
		<guid isPermaLink="false">http://gulati.info/?p=1717#comment-4675</guid>
		<description>I have been a programmer for nearly 30 years, with 20 years in c and c++ and 12 in PHP - so I have seen many styles. Coding style should be based on your own personal preference, or if you are employed by your companies preference.

I prefer Allman style myself because of its openness, as well as the fact that the control statement and its braces all line up. It seems more popular in c and C++. Whereas K&amp;R now seems more popular in PHP (such as in Drupal source code).

But for switch statements I tend to use my own style as follows:

switch (a)
{
case 1:
    b=1;
    break;
case 2:
    b=2;
    break;
}

Allman would normally, instead do the following:

switch (a)
{
    case 1:
        b=1;
        break;
    case 2:
        b=2;
        break;
}

The difference is that case statements seem alot like statement labels to me, which i never indent.</description>
		<content:encoded><![CDATA[<p>I have been a programmer for nearly 30 years, with 20 years in c and c++ and 12 in PHP &#8211; so I have seen many styles. Coding style should be based on your own personal preference, or if you are employed by your companies preference.</p>
<p>I prefer Allman style myself because of its openness, as well as the fact that the control statement and its braces all line up. It seems more popular in c and C++. Whereas K&amp;R now seems more popular in PHP (such as in Drupal source code).</p>
<p>But for switch statements I tend to use my own style as follows:</p>
<p>switch (a)<br />
{<br />
case 1:<br />
    b=1;<br />
    break;<br />
case 2:<br />
    b=2;<br />
    break;<br />
}</p>
<p>Allman would normally, instead do the following:</p>
<p>switch (a)<br />
{<br />
    case 1:<br />
        b=1;<br />
        break;<br />
    case 2:<br />
        b=2;<br />
        break;<br />
}</p>
<p>The difference is that case statements seem alot like statement labels to me, which i never indent.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke Nichols</title>
		<link>http://austingulati.com/2010/01/different-brace-styles-in-php/comment-page-1/#comment-4513</link>
		<dc:creator>Luke Nichols</dc:creator>
		<pubDate>Thu, 03 Mar 2011 00:17:18 +0000</pubDate>
		<guid isPermaLink="false">http://gulati.info/?p=1717#comment-4513</guid>
		<description>I&#039;ve always used Allman, even being completely oblivious to what it even was. I guess I just picked up on other code that I looked at, and adopted the style from my earliest tutorials that I read.

It&#039;s interesting to read about the other styles.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve always used Allman, even being completely oblivious to what it even was. I guess I just picked up on other code that I looked at, and adopted the style from my earliest tutorials that I read.</p>
<p>It&#8217;s interesting to read about the other styles.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kalfir</title>
		<link>http://austingulati.com/2010/01/different-brace-styles-in-php/comment-page-1/#comment-779</link>
		<dc:creator>Kalfir</dc:creator>
		<pubDate>Fri, 12 Mar 2010 10:37:33 +0000</pubDate>
		<guid isPermaLink="false">http://gulati.info/?p=1717#comment-779</guid>
		<description>Interesting. I always used K&amp;R untill I started working as a programmer. At my first work they used Allman and everyone had to use it to make the code homogeneous. But when working with projects other then our own I get the feeling that K&amp;R is the most commonly used method. So that&#039;s why I started searching if there is a style that is seen as the &quot;right&quot; one.</description>
		<content:encoded><![CDATA[<p>Interesting. I always used K&amp;R untill I started working as a programmer. At my first work they used Allman and everyone had to use it to make the code homogeneous. But when working with projects other then our own I get the feeling that K&amp;R is the most commonly used method. So that&#8217;s why I started searching if there is a style that is seen as the &#8220;right&#8221; one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Austin</title>
		<link>http://austingulati.com/2010/01/different-brace-styles-in-php/comment-page-1/#comment-695</link>
		<dc:creator>Austin</dc:creator>
		<pubDate>Thu, 28 Jan 2010 09:56:04 +0000</pubDate>
		<guid isPermaLink="false">http://gulati.info/?p=1717#comment-695</guid>
		<description>@therealbest.com

Thanks for your comment!</description>
		<content:encoded><![CDATA[<p>@therealbest.com</p>
<p>Thanks for your comment!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: therealbest.com</title>
		<link>http://austingulati.com/2010/01/different-brace-styles-in-php/comment-page-1/#comment-694</link>
		<dc:creator>therealbest.com</dc:creator>
		<pubDate>Thu, 28 Jan 2010 08:04:13 +0000</pubDate>
		<guid isPermaLink="false">http://gulati.info/?p=1717#comment-694</guid>
		<description>Whitesmiths style that I use, very ok :).</description>
		<content:encoded><![CDATA[<p>Whitesmiths style that I use, very ok :).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Austin</title>
		<link>http://austingulati.com/2010/01/different-brace-styles-in-php/comment-page-1/#comment-593</link>
		<dc:creator>Austin</dc:creator>
		<pubDate>Mon, 11 Jan 2010 23:46:34 +0000</pubDate>
		<guid isPermaLink="false">http://gulati.info/?p=1717#comment-593</guid>
		<description>@Tech-Freak

Yeah, there are a lot of different styles. Thanks for the comment!</description>
		<content:encoded><![CDATA[<p>@Tech-Freak</p>
<p>Yeah, there are a lot of different styles. Thanks for the comment!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tech-Freak Stuff</title>
		<link>http://austingulati.com/2010/01/different-brace-styles-in-php/comment-page-1/#comment-568</link>
		<dc:creator>Tech-Freak Stuff</dc:creator>
		<pubDate>Thu, 07 Jan 2010 13:11:51 +0000</pubDate>
		<guid isPermaLink="false">http://gulati.info/?p=1717#comment-568</guid>
		<description>WOW! I had the basic Idea how to use them, but I never knew that there are so many types too...</description>
		<content:encoded><![CDATA[<p>WOW! I had the basic Idea how to use them, but I never knew that there are so many types too&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

