<?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: Brain hurting mistakes of our&#160;time</title>
	<atom:link href="http://www.magpiebrain.com/blog/2004/01/13/brain-hurting-mistakes-of-our-time/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.magpiebrain.com/blog/2004/01/13/brain-hurting-mistakes-of-our-time/</link>
	<description>Sam Newman's blog</description>
	<pubDate>Sat, 05 Jul 2008 00:41:57 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: migs</title>
		<link>http://www.magpiebrain.com/blog/2004/01/13/brain-hurting-mistakes-of-our-time/#comment-150</link>
		<dc:creator>migs</dc:creator>
		<pubDate>Wed, 28 Jan 2004 04:33:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.magpiebrain.com/2004/01/13/brain-hurting-mistakes-of-our-time/#comment-150</guid>
		<description>Making ActionErrors final  (which I do by habit) would've spotted the first case.
</description>
		<content:encoded><![CDATA[<p>Making ActionErrors final  (which I do by habit) would&#8217;ve spotted the first case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jef</title>
		<link>http://www.magpiebrain.com/blog/2004/01/13/brain-hurting-mistakes-of-our-time/#comment-149</link>
		<dc:creator>jef</dc:creator>
		<pubDate>Mon, 19 Jan 2004 20:28:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.magpiebrain.com/2004/01/13/brain-hurting-mistakes-of-our-time/#comment-149</guid>
		<description>wheee!
For that matter, you'll also get the behavior that

boolean c = true;
boolean b = false;

if(b=c) {
System.out.println("text");
}

will always print, but 

if (c=b) {
System.out.println("text");
}

will never print.  Probably caused more than one VB developer to give up...  Once I spent an hour trying to figure out why 

if (somemethodcall(c));
{
System.out.println("text");
}

would always print even as I stepped again and again through the method observing that I hadn't botched the logic and that it really should be returning false...</description>
		<content:encoded><![CDATA[<p>wheee!<br />
For that matter, you&#8217;ll also get the behavior that</p>
<p>boolean c = true;<br />
boolean b = false;</p>
<p>if(b=c) {<br />
System.out.println(&#8220;text&#8221;);<br />
}</p>
<p>will always print, but </p>
<p>if (c=b) {<br />
System.out.println(&#8220;text&#8221;);<br />
}</p>
<p>will never print.  Probably caused more than one <acronym title="Visual Basic">VB</acronym> developer to give up&#8230;  Once I spent an hour trying to figure out why </p>
<p>if (somemethodcall&#169;);<br />
{<br />
System.out.println(&#8220;text&#8221;);<br />
}</p>
<p>would always print even as I stepped again and again through the method observing that I hadn&#8217;t botched the logic and that it really should be returning false&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: R.J.</title>
		<link>http://www.magpiebrain.com/blog/2004/01/13/brain-hurting-mistakes-of-our-time/#comment-148</link>
		<dc:creator>R.J.</dc:creator>
		<pubDate>Tue, 13 Jan 2004 18:28:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.magpiebrain.com/2004/01/13/brain-hurting-mistakes-of-our-time/#comment-148</guid>
		<description>Yeah, it's an interesting little known feature of Java assignment operators. In terms of 'operator overloading', it is essentially 'returning' the value of the assignment after performing the assignment on the variable.
That's why:
boolean c = true;
boolean b = false;
if(b=c) {
 System.out.println("text");
}
compiles and prints out text; unlike:
if(b==c) {
...
}
which doesn't.</description>
		<content:encoded><![CDATA[<p>Yeah, it&#8217;s an interesting little known feature of Java assignment operators. In terms of &#8216;operator overloading&#8217;, it is essentially &#8216;returning&#8217; the value of the assignment after performing the assignment on the variable.<br />
That&#8217;s why:<br />
boolean c = true;<br />
boolean b = false;<br />
if(b=c) {</p>
<p> System.out.println(&#8220;text&#8221;);<br />
}<br />
compiles and prints out text; unlike:<br />
if(b==c) {<br />
...<br />
}<br />
which doesn&#8217;t.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
