<?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: Coding Standards</title>
	<atom:link href="http://www.dereuromark.de/coding-standards/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dereuromark.de</link>
	<description>A blog about Frameworks (CakePHP), MVC, Snippets, Tips and more</description>
	<lastBuildDate>Mon, 06 Feb 2012 00:39:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Mark</title>
		<link>http://www.dereuromark.de/coding-standards/comment-page-1/#comment-4141</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Tue, 25 Jan 2011 23:27:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.dereuromark.de/#comment-4141</guid>
		<description>You are right
I covered it only briefly in
http://www.dereuromark.de/2011/01/16/coding-standards-in-php/

As stated, the readability increases dramatically (indentation is the keyword here). Your argument was strong when programmers didn&#039;t use  IDEs but pure txt-editors. But nowadays with a proper IDE you get the opening and closing bracket highlighted(!). That + the intendation is enough to make any code readable very beautifully.
And the main disadvantage of the new line style (did I already say that i hate it?^^) is that it triples(!!!) in most cases the length of the function. Totally nonsense in my opionion. Some (usually not very well written) functions can even extend the height of the screen, and there you are happy if no nonsense-lines are added :)

Example:

(good)
{code type=php}
# 7 lines
if ($varX) {
	$this-&gt;foo();
} elseif($varY) {
	$this-&gt;bar();	
} else {
	$this-&gt;end();	
}
{/code}

(bad)
{code type=php}
# 12 lines
if ($varX)
{
	$this-&gt;foo();
}
elseif ($varY)
{
	$this-&gt;bar();	
}
else 
{
	$this-&gt;end();	
}
{/code}

To emphasize for all those souls that are lost on the wrong path here:
The closing bracket is on the same vertical alignment as the condition/text that started it.
Thats about all that is needed.</description>
		<content:encoded><![CDATA[<p>You are right<br />
I covered it only briefly in<br />
<a href="http://www.dereuromark.de/2011/01/16/coding-standards-in-php/" rel="nofollow">http://www.dereuromark.de/2011/01/16/coding-standards-in-php/</a></p>
<p>As stated, the readability increases dramatically (indentation is the keyword here). Your argument was strong when programmers didn&#039;t use  IDEs but pure txt-editors. But nowadays with a proper IDE you get the opening and closing bracket highlighted(!). That + the intendation is enough to make any code readable very beautifully.<br />
And the main disadvantage of the new line style (did I already say that i hate it?^^) is that it triples(!!!) in most cases the length of the function. Totally nonsense in my opionion. Some (usually not very well written) functions can even extend the height of the screen, and there you are happy if no nonsense-lines are added <img src='http://www.dereuromark.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Example:</p>
<p>(good)</p>
<pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># 7 lines
</span><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$varX</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">foo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$varY</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">bar</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">end</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre>
<p>(bad)</p>
<pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># 12 lines
</span><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$varX</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">foo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$varY</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">bar</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">end</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre>
<p>To emphasize for all those souls that are lost on the wrong path here:<br />
The closing bracket is on the same vertical alignment as the condition/text that started it.<br />
Thats about all that is needed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Whootland</title>
		<link>http://www.dereuromark.de/coding-standards/comment-page-1/#comment-4108</link>
		<dc:creator>Whootland</dc:creator>
		<pubDate>Tue, 25 Jan 2011 19:52:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.dereuromark.de/#comment-4108</guid>
		<description>I agree with iNaD, having the { open bracket on a new line is a lot cleaner. This way you will have the open and close bracket on the same column (position vertically) and this makes it easier to see what code block it belongs to. If you put it on the same line it (in my opinion) looks crooked.  Especialy when you have a lot of nesting with many ifs/foreaches/etc.

I wonder what your reasons are for doing this, because you didn&#039;t post an explanation for this opinion. Just wondering...

Great blog by the way!</description>
		<content:encoded><![CDATA[<p>I agree with iNaD, having the { open bracket on a new line is a lot cleaner. This way you will have the open and close bracket on the same column (position vertically) and this makes it easier to see what code block it belongs to. If you put it on the same line it (in my opinion) looks crooked.  Especialy when you have a lot of nesting with many ifs/foreaches/etc.</p>
<p>I wonder what your reasons are for doing this, because you didn&#039;t post an explanation for this opinion. Just wondering&#8230;</p>
<p>Great blog by the way!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://www.dereuromark.de/coding-standards/comment-page-1/#comment-1384</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Mon, 20 Dec 2010 23:00:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.dereuromark.de/#comment-1384</guid>
		<description>I hate it!
It&#039;s on of the things that really upsets me about other code if the {} brackets are not correctly set^^
everything is debatable, but not this, in my opinion.
grrrr</description>
		<content:encoded><![CDATA[<p>I hate it!<br />
It&#039;s on of the things that really upsets me about other code if the {} brackets are not correctly set^^<br />
everything is debatable, but not this, in my opinion.<br />
grrrr</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iNaD</title>
		<link>http://www.dereuromark.de/coding-standards/comment-page-1/#comment-1380</link>
		<dc:creator>iNaD</dc:creator>
		<pubDate>Mon, 20 Dec 2010 19:46:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.dereuromark.de/#comment-1380</guid>
		<description>Hi guys,
it&#039;s always interesting to see how others think about coding guidelines / standards.
Personally I like it more if the { open bracket is in a new line. For me it&#039;s a better overview, but everyone has to make his own decision I think?!
But this is a nice introduction to new developers =]</description>
		<content:encoded><![CDATA[<p>Hi guys,<br />
it&#039;s always interesting to see how others think about coding guidelines / standards.<br />
Personally I like it more if the { open bracket is in a new line. For me it&#039;s a better overview, but everyone has to make his own decision I think?!<br />
But this is a nice introduction to new developers =]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

