<?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"
	>
<channel>
	<title>Comments on: {curly brackets} versus :colons/semi-colons; in PHP</title>
	<atom:link href="http://imgiseverything.co.uk/2008/06/10/curly-brackets-colons-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://imgiseverything.co.uk/2008/06/10/curly-brackets-colons-php/</link>
	<description>Manchester web designer Phil Thompson</description>
	<pubDate>Wed, 03 Dec 2008 21:44:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Ian Jenkins</title>
		<link>http://imgiseverything.co.uk/2008/06/10/curly-brackets-colons-php/#comment-90013</link>
		<dc:creator>Ian Jenkins</dc:creator>
		<pubDate>Tue, 10 Jun 2008 19:51:06 +0000</pubDate>
		<guid isPermaLink="false">http://imgiseverything.co.uk/?p=260#comment-90013</guid>
		<description>I use Textpad (windows only - but is very good) ctrl-m on a bracket will match it up.  I often use smarty for templates but if only using php then the short hand syntax comes in very useful.</description>
		<content:encoded><![CDATA[<p>I use Textpad (windows only - but is very good) ctrl-m on a bracket will match it up.  I often use smarty for templates but if only using php then the short hand syntax comes in very useful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: phil</title>
		<link>http://imgiseverything.co.uk/2008/06/10/curly-brackets-colons-php/#comment-90006</link>
		<dc:creator>phil</dc:creator>
		<pubDate>Tue, 10 Jun 2008 18:35:21 +0000</pubDate>
		<guid isPermaLink="false">http://imgiseverything.co.uk/?p=260#comment-90006</guid>
		<description>@Mark James: I see, I've just checked in Coda and it does indeed do what you say. Double-clicking the bracket actually highlights the entire block. Which is very useful. Textmate will collapse an entire block if you press F1 with both syntax styles.</description>
		<content:encoded><![CDATA[<p>@Mark James: I see, I&#8217;ve just checked in Coda and it does indeed do what you say. Double-clicking the bracket actually highlights the entire block. Which is very useful. Textmate will collapse an entire block if you press F1 with both syntax styles.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark James</title>
		<link>http://imgiseverything.co.uk/2008/06/10/curly-brackets-colons-php/#comment-89993</link>
		<dc:creator>Mark James</dc:creator>
		<pubDate>Tue, 10 Jun 2008 16:35:29 +0000</pubDate>
		<guid isPermaLink="false">http://imgiseverything.co.uk/?p=260#comment-89993</guid>
		<description>Coda definitely has brace matching (it 'pings' the matching brace when you move your caret over it). Doesn't look like Dreamweaver does, Textmate does also (changes background colour on braces when caret'ing across the matching brace, but not on alt. syntax). Doesnt look like any of them can highlight the endx; syntax though.

Forgot to clarify earlier that the reason I use alternative syntax in views/templates is that, when I have a large number of documents open, it makes it very clear which ones are 'templates' and which ones should actually do the work (acts as a quick visual hook per file to the context of development).</description>
		<content:encoded><![CDATA[<p>Coda definitely has brace matching (it &#8216;pings&#8217; the matching brace when you move your caret over it). Doesn&#8217;t look like Dreamweaver does, Textmate does also (changes background colour on braces when caret&#8217;ing across the matching brace, but not on alt. syntax). Doesnt look like any of them can highlight the endx; syntax though.</p>
<p>Forgot to clarify earlier that the reason I use alternative syntax in views/templates is that, when I have a large number of documents open, it makes it very clear which ones are &#8216;templates&#8217; and which ones should actually do the work (acts as a quick visual hook per file to the context of development).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: phil</title>
		<link>http://imgiseverything.co.uk/2008/06/10/curly-brackets-colons-php/#comment-89986</link>
		<dc:creator>phil</dc:creator>
		<pubDate>Tue, 10 Jun 2008 15:43:30 +0000</pubDate>
		<guid isPermaLink="false">http://imgiseverything.co.uk/?p=260#comment-89986</guid>
		<description>@Ian: which editors do you use which do support bracket matching and not the alternative syntax matching. As I only use a combo of either DreamWeaver/Coda which (correct me if I'm wrong) don't support either syntax but I've just downloaded Textmate in the last 5 minutes and that seems to support both.</description>
		<content:encoded><![CDATA[<p>@Ian: which editors do you use which do support bracket matching and not the alternative syntax matching. As I only use a combo of either DreamWeaver/Coda which (correct me if I&#8217;m wrong) don&#8217;t support either syntax but I&#8217;ve just downloaded Textmate in the last 5 minutes and that seems to support both.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://imgiseverything.co.uk/2008/06/10/curly-brackets-colons-php/#comment-89984</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Tue, 10 Jun 2008 15:29:20 +0000</pubDate>
		<guid isPermaLink="false">http://imgiseverything.co.uk/?p=260#comment-89984</guid>
		<description>You still run into the same problem if you start nesting lots of functions using this alternative syntax. Maybe not as soon as with braces, but not much later. I do like these syntaxes (correct plural?) but I prefer to use comments to label my closing braces, just like how many people label closing tags in html. Usually a comment like " } //if (condition) " is enough to jog my memory and help me figure out which opening brace a particular closing one corresponds to.

Like I said though, I do like the ability to use endif, reminds me of bash :)</description>
		<content:encoded><![CDATA[<p>You still run into the same problem if you start nesting lots of functions using this alternative syntax. Maybe not as soon as with braces, but not much later. I do like these syntaxes (correct plural?) but I prefer to use comments to label my closing braces, just like how many people label closing tags in html. Usually a comment like &#8221; } //if (condition) &#8221; is enough to jog my memory and help me figure out which opening brace a particular closing one corresponds to.</p>
<p>Like I said though, I do like the ability to use endif, reminds me of bash :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian Jenkins</title>
		<link>http://imgiseverything.co.uk/2008/06/10/curly-brackets-colons-php/#comment-89983</link>
		<dc:creator>Ian Jenkins</dc:creator>
		<pubDate>Tue, 10 Jun 2008 15:28:26 +0000</pubDate>
		<guid isPermaLink="false">http://imgiseverything.co.uk/?p=260#comment-89983</guid>
		<description>I share your hatred of poorly written code.  However, I agree with Marks comment (excellent comment by the way ;)).  The alternative syntax is very useful for your views/templates but for other stuff I would be tempted to keep the curly braces.  One of the main reasons is bracket matching.  I know its a small feature of code editors, but what a helpful little feature it is.</description>
		<content:encoded><![CDATA[<p>I share your hatred of poorly written code.  However, I agree with Marks comment (excellent comment by the way ;)).  The alternative syntax is very useful for your views/templates but for other stuff I would be tempted to keep the curly braces.  One of the main reasons is bracket matching.  I know its a small feature of code editors, but what a helpful little feature it is.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: phil</title>
		<link>http://imgiseverything.co.uk/2008/06/10/curly-brackets-colons-php/#comment-89980</link>
		<dc:creator>phil</dc:creator>
		<pubDate>Tue, 10 Jun 2008 14:54:54 +0000</pubDate>
		<guid isPermaLink="false">http://imgiseverything.co.uk/?p=260#comment-89980</guid>
		<description>@Mark: I see your point. If anything that the fact that the curly brackets are also used for classes, methods et al means it can get even more confusing.

I found myself, commenting all my curly brackets like so: &lt;code&gt; } // end if&lt;/code&gt; or &lt;code&gt;} // end for loop &lt;/code&gt; just to be able to remember what they belonged to, so altering the syntax feels like natural progress to me.</description>
		<content:encoded><![CDATA[<p>@Mark: I see your point. If anything that the fact that the curly brackets are also used for classes, methods et al means it can get even more confusing.</p>
<p>I found myself, commenting all my curly brackets like so: <code> } // end if</code> or <code>} // end for loop </code> just to be able to remember what they belonged to, so altering the syntax feels like natural progress to me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark James</title>
		<link>http://imgiseverything.co.uk/2008/06/10/curly-brackets-colons-php/#comment-89977</link>
		<dc:creator>Mark James</dc:creator>
		<pubDate>Tue, 10 Jun 2008 14:49:06 +0000</pubDate>
		<guid isPermaLink="false">http://imgiseverything.co.uk/?p=260#comment-89977</guid>
		<description>Curly braces are not especially hard to read if you have experience in any C-style language (such as PHP). Most editors will show you a matching brace (but will not show you a matching endfor/endif), so it depends on the experience and viewpoints of your fellow devs and which tools you have in place to support development.

I do agree that the alternate syntax is slightly easier to track when using PHP embedded in large HTML files ( (we use them here for views/templates only), but I'd be a little wary of forcing other developers (that you may never talk to) to maintain such an uncommon coding style for classes and other files. Any personal style which could be referenced after your employment with the company as 'Phil had a habit of…' is something I'd think long and hard before enforcing adoption.

Plus you're still tied into using curly braces for your classes, methods, functions, third party code, etc, so I'd consider it muddying the syntax waters.</description>
		<content:encoded><![CDATA[<p>Curly braces are not especially hard to read if you have experience in any C-style language (such as PHP). Most editors will show you a matching brace (but will not show you a matching endfor/endif), so it depends on the experience and viewpoints of your fellow devs and which tools you have in place to support development.</p>
<p>I do agree that the alternate syntax is slightly easier to track when using PHP embedded in large HTML files ( (we use them here for views/templates only), but I&#8217;d be a little wary of forcing other developers (that you may never talk to) to maintain such an uncommon coding style for classes and other files. Any personal style which could be referenced after your employment with the company as &#8216;Phil had a habit of…&#8217; is something I&#8217;d think long and hard before enforcing adoption.</p>
<p>Plus you&#8217;re still tied into using curly braces for your classes, methods, functions, third party code, etc, so I&#8217;d consider it muddying the syntax waters.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: phil</title>
		<link>http://imgiseverything.co.uk/2008/06/10/curly-brackets-colons-php/#comment-89974</link>
		<dc:creator>phil</dc:creator>
		<pubDate>Tue, 10 Jun 2008 14:39:07 +0000</pubDate>
		<guid isPermaLink="false">http://imgiseverything.co.uk/?p=260#comment-89974</guid>
		<description>@stuart: yes it has but I've just gone in and updated the CSS, so it should be indented properly if you F5 the site.</description>
		<content:encoded><![CDATA[<p>@stuart: yes it has but I&#8217;ve just gone in and updated the CSS, so it should be indented properly if you F5 the site.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stuart Grimshaw</title>
		<link>http://imgiseverything.co.uk/2008/06/10/curly-brackets-colons-php/#comment-89970</link>
		<dc:creator>Stuart Grimshaw</dc:creator>
		<pubDate>Tue, 10 Jun 2008 14:15:39 +0000</pubDate>
		<guid isPermaLink="false">http://imgiseverything.co.uk/?p=260#comment-89970</guid>
		<description>Has your blogging software removed all the tabs and indenting? It still looks hard to read to me.</description>
		<content:encoded><![CDATA[<p>Has your blogging software removed all the tabs and indenting? It still looks hard to read to me.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
