<?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: Try to read this code</title>
	<atom:link href="http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/</link>
	<description>A blog about Adobe Flex</description>
	<lastBuildDate>Mon, 15 Mar 2010 09:04:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Nad</title>
		<link>http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/comment-page-1/#comment-1219</link>
		<dc:creator>Nad</dc:creator>
		<pubDate>Sun, 25 Mar 2007 10:49:44 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/#comment-1219</guid>
		<description>some correction
if (isNan(btb)){
if (controlBar==true &amp;&amp; !isNaN(btt)) {
crap=btt; 
} else {
if (isNaN(btl)) crap=bt; else crap=btl;
}
} else crap=btb;
vm.bottom = o.bottom + crap</description>
		<content:encoded><![CDATA[<p>some correction<br />
if (isNan(btb)){<br />
if (controlBar==true &amp;&amp; !isNaN(btt)) {<br />
crap=btt;<br />
} else {<br />
if (isNaN(btl)) crap=bt; else crap=btl;<br />
}<br />
} else crap=btb;<br />
vm.bottom = o.bottom + crap</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nad</title>
		<link>http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/comment-page-1/#comment-1218</link>
		<dc:creator>Nad</dc:creator>
		<pubDate>Sun, 25 Mar 2007 10:44:19 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/#comment-1218</guid>
		<description>if (isNan(btb)){
  if (controlBar==true &amp;&amp; !isNaN(btt)) crap=btt; else {
      if (isNaN(btl)) crap=bt; else crap=btl;
      }
  } else crap=btb;
} else crap=btb;
vm.bottom = o.bottom + crap</description>
		<content:encoded><![CDATA[<p>if (isNan(btb)){<br />
  if (controlBar==true &amp;&amp; !isNaN(btt)) crap=btt; else {<br />
      if (isNaN(btl)) crap=bt; else crap=btl;<br />
      }<br />
  } else crap=btb;<br />
} else crap=btb;<br />
vm.bottom = o.bottom + crap</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ternaries, &#124;&#124;, and cleaner clode... &#171; Aaron King&#8217;s Flex Blog</title>
		<link>http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/comment-page-1/#comment-1160</link>
		<dc:creator>Ternaries, &#124;&#124;, and cleaner clode... &#171; Aaron King&#8217;s Flex Blog</dc:creator>
		<pubDate>Thu, 22 Mar 2007 23:06:20 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/#comment-1160</guid>
		<description>[...] March 22nd, 2007   In my first post, I mentioned a post over on Doug McCune&#8217;s Blog that finally tipped me over the edge to start blogging. So, here&#8217;s it is&#8230; [...]</description>
		<content:encoded><![CDATA[<p>[...] March 22nd, 2007   In my first post, I mentioned a post over on Doug McCune&#8217;s Blog that finally tipped me over the edge to start blogging. So, here&#8217;s it is&#8230; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hello world! &#171; Aaron King&#8217;s Flex Blog</title>
		<link>http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/comment-page-1/#comment-1157</link>
		<dc:creator>Hello world! &#171; Aaron King&#8217;s Flex Blog</dc:creator>
		<pubDate>Thu, 22 Mar 2007 21:42:02 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/#comment-1157</guid>
		<description>[...] Hello&#160;world!  Hello World!  Okay, Okay, Okay.   So I was reading a post on Doug McCune&#8217;s blog this morning, and I started a reply.  Well, the reply started getting so long and drawn out that I finally said to myself, &#8220;Ya know, this really should be a blog post all to itself.&#8221;  And thus tipped the scales&#8230;  I finally did what I&#8217;ve been thinking about for ages and started a blog. [...]</description>
		<content:encoded><![CDATA[<p>[...] Hello&nbsp;world!  Hello World!  Okay, Okay, Okay.   So I was reading a post on Doug McCune&#8217;s blog this morning, and I started a reply.  Well, the reply started getting so long and drawn out that I finally said to myself, &#8220;Ya know, this really should be a blog post all to itself.&#8221;  And thus tipped the scales&#8230;  I finally did what I&#8217;ve been thinking about for ages and started a blog. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug</title>
		<link>http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/comment-page-1/#comment-1147</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Thu, 22 Mar 2007 16:21:05 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/#comment-1147</guid>
		<description>Sorry to everyone who was trying to post formatted code in the comments and got the indenting all messed up. The secret was using the &lt;pre &gt; AND the &lt;code &gt; tags nested together.

I went ahead and edited people&#039;s comments to try to get the formatting how I think it was supposed to be. Hopefully I didn&#039;t mis-format anyone&#039;s code.</description>
		<content:encoded><![CDATA[<p>Sorry to everyone who was trying to post formatted code in the comments and got the indenting all messed up. The secret was using the &lt;pre &gt; AND the &lt;code &gt; tags nested together.</p>
<p>I went ahead and edited people&#8217;s comments to try to get the formatting how I think it was supposed to be. Hopefully I didn&#8217;t mis-format anyone&#8217;s code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chuck</title>
		<link>http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/comment-page-1/#comment-1146</link>
		<dc:creator>chuck</dc:creator>
		<pubDate>Thu, 22 Mar 2007 16:12:33 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/#comment-1146</guid>
		<description>Since Wordpress has a problem with formatting code in comments, I posted my revised indentation of the offending line at my site -- it&#039;s the trackback above from &quot;nothing happens.&quot;</description>
		<content:encoded><![CDATA[<p>Since Wordpress has a problem with formatting code in comments, I posted my revised indentation of the offending line at my site &#8212; it&#8217;s the trackback above from &#8220;nothing happens.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gabriel montagné</title>
		<link>http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/comment-page-1/#comment-1143</link>
		<dc:creator>gabriel montagné</dc:creator>
		<pubDate>Thu, 22 Mar 2007 14:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/#comment-1143</guid>
		<description>with a minimal cleanup, the initial code could actually be very clear to read:

&lt;pre&gt;
&lt;code&gt;
vm.bottom = o.bottom + (     

            !isNaN(btb)                 ? btb
        :   controlBar &amp;&amp; !isNaN(btt)   ? btt
        :   isNaN(btl)                  ? bt
        :   btl
        ;
);
&lt;/code&gt;
&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>with a minimal cleanup, the initial code could actually be very clear to read:</p>
<pre>
<code>
vm.bottom = o.bottom + (     

            !isNaN(btb)                 ? btb
        :   controlBar &amp;&amp; !isNaN(btt)   ? btt
        :   isNaN(btl)                  ? bt
        :   btl
        ;
);
</code>
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: gabriel montagné</title>
		<link>http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/comment-page-1/#comment-1141</link>
		<dc:creator>gabriel montagné</dc:creator>
		<pubDate>Thu, 22 Mar 2007 14:29:22 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/#comment-1141</guid>
		<description>Well, ternaries can actually clear up the production of some values, making it clear the conditions for each particular value, as well as a default value at the end.  If properly indented, the can be way clearer than a long set of ifs and elses.
&lt;pre&gt;
&lt;code&gt;
var something  = conditionA  ? valueA
               : conditionB  ? valueB
               : conditionC  ? valueC
               : conditionD  ? valueD
               : default
               ;
&lt;/code&gt;
&lt;/pre&gt;
It is likely that the layout won&#039;t come out OK(tm) in this comment, but a clear way of indenting this is to line the : with the = assignment operator, and all the ? in the same column.. that way the default value will stand out at the end (and leaving it out will cause a syntax error!)</description>
		<content:encoded><![CDATA[<p>Well, ternaries can actually clear up the production of some values, making it clear the conditions for each particular value, as well as a default value at the end.  If properly indented, the can be way clearer than a long set of ifs and elses.</p>
<pre>
<code>
var something  = conditionA  ? valueA
               : conditionB  ? valueB
               : conditionC  ? valueC
               : conditionD  ? valueD
               : default
               ;
</code>
</pre>
<p>It is likely that the layout won&#8217;t come out OK(tm) in this comment, but a clear way of indenting this is to line the : with the = assignment operator, and all the ? in the same column.. that way the default value will stand out at the end (and leaving it out will cause a syntax error!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nothing happens</title>
		<link>http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/comment-page-1/#comment-1138</link>
		<dc:creator>nothing happens</dc:creator>
		<pubDate>Thu, 22 Mar 2007 14:13:48 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/#comment-1138</guid>
		<description>[...] [due to]  computing, Flash/ActionScript programming [...]</description>
		<content:encoded><![CDATA[<p>[...] [due to]  computing, Flash/ActionScript programming [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chuck</title>
		<link>http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/comment-page-1/#comment-1132</link>
		<dc:creator>chuck</dc:creator>
		<pubDate>Thu, 22 Mar 2007 12:53:56 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2007/03/21/try-to-read-this-code/#comment-1132</guid>
		<description>I like the ternary operator, but I&#039;ve over-used it on occasion.  I think the thing I liked about it was that I had really liked the Scheme/Lisp I was exposed to in school, and in Lisp the &quot;if&quot; statement is actually pretty much just like the ternary operator.  So I got kind of used to it.

I think the readability can be helped with some indenting... let&#039;s see if I can get Wordpress to do this:
&lt;pre&gt;
&lt;code&gt;
vm.bottom = o.bottom +
   (isNaN(btb) ? 
      (controlBar &amp;&amp; !isNaN(btt) ? 
         btt :
         isNaN(btl) ? bt : btl) :
      btb);
&lt;/pre&gt;&lt;/code&gt;
Now if we could just do something about those awful variable names.</description>
		<content:encoded><![CDATA[<p>I like the ternary operator, but I&#8217;ve over-used it on occasion.  I think the thing I liked about it was that I had really liked the Scheme/Lisp I was exposed to in school, and in Lisp the &#8220;if&#8221; statement is actually pretty much just like the ternary operator.  So I got kind of used to it.</p>
<p>I think the readability can be helped with some indenting&#8230; let&#8217;s see if I can get Wordpress to do this:</p>
<pre>
<code>
vm.bottom = o.bottom +
   (isNaN(btb) ?
      (controlBar &amp;&amp; !isNaN(btt) ?
         btt :
         isNaN(btl) ? bt : btl) :
      btb);
</code></pre>
<p>Now if we could just do something about those awful variable names.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
