<?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: PHP Shorthand if and else assignments</title>
	<atom:link href="http://www.birdandcocreative.co.uk/php-shorthand-if-and-else-assignments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.birdandcocreative.co.uk/php-shorthand-if-and-else-assignments/</link>
	<description></description>
	<lastBuildDate>Mon, 09 Aug 2010 08:01:04 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Chad Huntley</title>
		<link>http://www.birdandcocreative.co.uk/php-shorthand-if-and-else-assignments/comment-page-1/#comment-250</link>
		<dc:creator>Chad Huntley</dc:creator>
		<pubDate>Mon, 15 Mar 2010 12:35:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.birdandcocreative.co.uk/?p=1260#comment-250</guid>
		<description>I&#039;ve found a good use for the ternary operator is when writing small conditional statements inline with HTML.

For example, if you want to add a class to a DIV when a certain condition is true. While still making things readable you can put a short snippet of PHP code within the class area to echo a new class. Not exactly A+ coding, but its a good quick way to get the job done.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve found a good use for the ternary operator is when writing small conditional statements inline with HTML.</p>
<p>For example, if you want to add a class to a DIV when a certain condition is true. While still making things readable you can put a short snippet of PHP code within the class area to echo a new class. Not exactly A+ coding, but its a good quick way to get the job done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://www.birdandcocreative.co.uk/php-shorthand-if-and-else-assignments/comment-page-1/#comment-174</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Wed, 17 Feb 2010 11:11:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.birdandcocreative.co.uk/?p=1260#comment-174</guid>
		<description>Hi,

Nice topic. I come from a Perl background, where the less code you write the smarter you are - or at least I think that&#039;s the general way it works! Lol

I&#039;ve only just started using ternary operators in my PHP code though, but I think they&#039;re great.

I also think that if they are used sensibly, they don&#039;t have to make the code any less maintainable. I&#039;m a bit OCD when it comes to making code look pretty, and sometimes I think having less lines to scroll through actually makes your code easier and quicker to understand - it just takes a little getting used to, but once you&#039;re happy with the syntax it&#039;s fine.

Tom</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Nice topic. I come from a Perl background, where the less code you write the smarter you are &#8211; or at least I think that&#8217;s the general way it works! Lol</p>
<p>I&#8217;ve only just started using ternary operators in my PHP code though, but I think they&#8217;re great.</p>
<p>I also think that if they are used sensibly, they don&#8217;t have to make the code any less maintainable. I&#8217;m a bit OCD when it comes to making code look pretty, and sometimes I think having less lines to scroll through actually makes your code easier and quicker to understand &#8211; it just takes a little getting used to, but once you&#8217;re happy with the syntax it&#8217;s fine.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://www.birdandcocreative.co.uk/php-shorthand-if-and-else-assignments/comment-page-1/#comment-136</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Thu, 11 Feb 2010 16:32:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.birdandcocreative.co.uk/?p=1260#comment-136</guid>
		<description>Hi Derick, 

Thanks for your comment, and I agree completely on maintainable readable code. 

The point of the post was more one of introducing people to the ternary operator and a few ways of using it. I have spoken to quite a lot of developers who simply don&#039;t know what it is! 
They are silly examples precisely because you wouldn&#039;t want to use them... of course we can go to the pub on other days!</description>
		<content:encoded><![CDATA[<p>Hi Derick, </p>
<p>Thanks for your comment, and I agree completely on maintainable readable code. </p>
<p>The point of the post was more one of introducing people to the ternary operator and a few ways of using it. I have spoken to quite a lot of developers who simply don&#8217;t know what it is!<br />
They are silly examples precisely because you wouldn&#8217;t want to use them&#8230; of course we can go to the pub on other days!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derick</title>
		<link>http://www.birdandcocreative.co.uk/php-shorthand-if-and-else-assignments/comment-page-1/#comment-135</link>
		<dc:creator>Derick</dc:creator>
		<pubDate>Thu, 11 Feb 2010 15:15:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.birdandcocreative.co.uk/?p=1260#comment-135</guid>
		<description>Hi,

first of all I disagree that you can only go to pubs on Friday&#039;s, but secondly (and more seriously), writing PHP code (or actually any code) isn&#039;t always about writing code in the least amount of keystrokes. It&#039;s just as important to write *maintainable code*. The ternary operator isn&#039;t always the best possible choice to write readable code, especially not when you nest them.

Derick</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>first of all I disagree that you can only go to pubs on Friday&#8217;s, but secondly (and more seriously), writing PHP code (or actually any code) isn&#8217;t always about writing code in the least amount of keystrokes. It&#8217;s just as important to write *maintainable code*. The ternary operator isn&#8217;t always the best possible choice to write readable code, especially not when you nest them.</p>
<p>Derick</p>
]]></content:encoded>
	</item>
</channel>
</rss>