<?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: Useless use of if award</title>
	<atom:link href="http://ebergen.net/wordpress/2006/07/21/useless-use-of-if-award/feed/" rel="self" type="application/rss+xml" />
	<link>http://ebergen.net/wordpress/2006/07/21/useless-use-of-if-award/</link>
	<description>You will probably want some waders, a pickaxe, and one of those hats with a light on it before you go in here.</description>
	<lastBuildDate>Fri, 11 May 2012 07:02:34 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Arno</title>
		<link>http://ebergen.net/wordpress/2006/07/21/useless-use-of-if-award/comment-page-1/#comment-2976</link>
		<dc:creator>Arno</dc:creator>
		<pubDate>Sun, 23 Jul 2006 06:11:48 +0000</pubDate>
		<guid isPermaLink="false">http://ebergen.net/wordpress/2006/07/21/useless-use-of-if-award/#comment-2976</guid>
		<description>While the PHP example is a valid one, I don&#039;t think that  SUM(your_field  ‘’)  is a good one. It implies that a boolean type TRUE is always cast into an interger 1. Which is not always the case. I have seen boolean TRUE as 1, 255, -1, and just about any other 32bit value in different languages, versions, and compilers over time.

Who says that MySQL (which I assume the SUM example was run on) does not change the boolean-&gt;int cast from 1-&gt;-1 in a next release?</description>
		<content:encoded><![CDATA[<p>While the PHP example is a valid one, I don&#8217;t think that  SUM(your_field  ‘’)  is a good one. It implies that a boolean type TRUE is always cast into an interger 1. Which is not always the case. I have seen boolean TRUE as 1, 255, -1, and just about any other 32bit value in different languages, versions, and compilers over time.</p>
<p>Who says that MySQL (which I assume the SUM example was run on) does not change the boolean-&gt;int cast from 1-&gt;-1 in a next release?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Pieter Kunst</title>
		<link>http://ebergen.net/wordpress/2006/07/21/useless-use-of-if-award/comment-page-1/#comment-2968</link>
		<dc:creator>Jan Pieter Kunst</dc:creator>
		<pubDate>Fri, 21 Jul 2006 21:18:11 +0000</pubDate>
		<guid isPermaLink="false">http://ebergen.net/wordpress/2006/07/21/useless-use-of-if-award/#comment-2968</guid>
		<description>I don&#039;t like &#039;saving keystrokes&#039; when writing code. That leads to the slippery slope of incomprehensible, write-only code. In fact, I never even use the ternary operator. I would write your PHP example like so:
&lt;blockquote&gt;
$str = &#039;foo&#039;;

if ($str == &#039;foo&#039;) {
  return TRUE;
} else {
  return FALSE;
}
&lt;/blockquote&gt;

Uncool, isn&#039;t it?</description>
		<content:encoded><![CDATA[<p>I don&#8217;t like &#8216;saving keystrokes&#8217; when writing code. That leads to the slippery slope of incomprehensible, write-only code. In fact, I never even use the ternary operator. I would write your PHP example like so:</p>
<blockquote><p>
$str = &#8216;foo&#8217;;</p>
<p>if ($str == &#8216;foo&#8217;) {<br />
  return TRUE;<br />
} else {<br />
  return FALSE;<br />
}
</p></blockquote>
<p>Uncool, isn&#8217;t it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Machmeier</title>
		<link>http://ebergen.net/wordpress/2006/07/21/useless-use-of-if-award/comment-page-1/#comment-2967</link>
		<dc:creator>Christian Machmeier</dc:creator>
		<pubDate>Fri, 21 Jul 2006 20:48:19 +0000</pubDate>
		<guid isPermaLink="false">http://ebergen.net/wordpress/2006/07/21/useless-use-of-if-award/#comment-2967</guid>
		<description>WP snipped my function! :(

function foo() {
  return true;
}</description>
		<content:encoded><![CDATA[<p>WP snipped my function! <img src='http://ebergen.net/wordpress/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>function foo() {<br />
  return true;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Machmeier</title>
		<link>http://ebergen.net/wordpress/2006/07/21/useless-use-of-if-award/comment-page-1/#comment-2966</link>
		<dc:creator>Christian Machmeier</dc:creator>
		<pubDate>Fri, 21 Jul 2006 20:46:23 +0000</pubDate>
		<guid isPermaLink="false">http://ebergen.net/wordpress/2006/07/21/useless-use-of-if-award/#comment-2966</guid>
		<description>Hm…

I tried to optimize the function even more and after hard hours of profiling, I came up with:


;)</description>
		<content:encoded><![CDATA[<p>Hm…</p>
<p>I tried to optimize the function even more and after hard hours of profiling, I came up with:</p>
<p> <img src='http://ebergen.net/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

