
<?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: Conditionals</title>
	<atom:link href="http://www.helenemartin.com/2009-12-conditionals/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.helenemartin.com/2009-12-conditionals/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=conditionals</link>
	<description>Education, computer science, sewing...</description>
	<lastBuildDate>Wed, 01 Sep 2010 03:46:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Hélène Martin</title>
		<link>http://www.helenemartin.com/2009-12-conditionals/comment-page-1/#comment-140</link>
		<dc:creator>Hélène Martin</dc:creator>
		<pubDate>Sun, 23 May 2010 15:18:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.helenemartin.com/?p=261#comment-140</guid>
		<description>Michael!  That&#039;s gross!</description>
		<content:encoded><![CDATA[<p>Michael!  That&#8217;s gross!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Rosenberger</title>
		<link>http://www.helenemartin.com/2009-12-conditionals/comment-page-1/#comment-138</link>
		<dc:creator>Michael Rosenberger</dc:creator>
		<pubDate>Sun, 23 May 2010 07:59:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.helenemartin.com/?p=261#comment-138</guid>
		<description>Hmm... 

How about:

def choose_todo(temp, mood):
     print([[&#039;go hiking&#039;, &#039;go fishing&#039;], [&#039;go hiking&#039;, &#039;stay home&#039;]][temp == &#039;below
     60&#039;][mood == &#039;sad&#039;])

Less readable, probably runs slower than the if-elif-else ladder cause you have to pay for the object creation; I&#039;m just bored and felt like writing an alternate solution :P

Dave&#039;s wins in terms of readability and elegance, though.</description>
		<content:encoded><![CDATA[<p>Hmm&#8230; </p>
<p>How about:</p>
<p>def choose_todo(temp, mood):<br />
     print([['go hiking', 'go fishing'], ['go hiking', 'stay home']][temp == 'below<br />
     60'][mood == 'sad'])</p>
<p>Less readable, probably runs slower than the if-elif-else ladder cause you have to pay for the object creation; I&#8217;m just bored and felt like writing an alternate solution <img src='http://www.helenemartin.com/wordpress/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Dave&#8217;s wins in terms of readability and elegance, though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hélène Martin</title>
		<link>http://www.helenemartin.com/2009-12-conditionals/comment-page-1/#comment-64</link>
		<dc:creator>Hélène Martin</dc:creator>
		<pubDate>Mon, 04 Jan 2010 00:18:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.helenemartin.com/?p=261#comment-64</guid>
		<description>Ahh... good one.  No, I didn&#039;t see that, but it&#039;s probably because I hadn&#039;t shown them anything like it.

That being said, I recently showed a couple of strong students and article on functional programming in Python and they really loved that syntax.  Maybe it&#039;s something I&#039;ll teach more explicitly in the future.</description>
		<content:encoded><![CDATA[<p>Ahh&#8230; good one.  No, I didn&#8217;t see that, but it&#8217;s probably because I hadn&#8217;t shown them anything like it.</p>
<p>That being said, I recently showed a couple of strong students and article on functional programming in Python and they really loved that syntax.  Maybe it&#8217;s something I&#8217;ll teach more explicitly in the future.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Briccetti</title>
		<link>http://www.helenemartin.com/2009-12-conditionals/comment-page-1/#comment-62</link>
		<dc:creator>Dave Briccetti</dc:creator>
		<pubDate>Wed, 30 Dec 2009 06:14:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.helenemartin.com/?p=261#comment-62</guid>
		<description>Hi. Did anybody write this?

print &quot;Go hiking&quot; if mood == &quot;happy&quot; else &quot;Go fishing&quot; if temp &gt;= 60 else &quot;Stay home&quot;</description>
		<content:encoded><![CDATA[<p>Hi. Did anybody write this?</p>
<p>print &#8220;Go hiking&#8221; if mood == &#8220;happy&#8221; else &#8220;Go fishing&#8221; if temp &gt;= 60 else &#8220;Stay home&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hélène Martin</title>
		<link>http://www.helenemartin.com/2009-12-conditionals/comment-page-1/#comment-56</link>
		<dc:creator>Hélène Martin</dc:creator>
		<pubDate>Sun, 06 Dec 2009 01:53:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.helenemartin.com/?p=261#comment-56</guid>
		<description>That coddinghorror article is a good one I hadn&#039;t read -- thanks for pointing out.  Now I&#039;m curious to give my students a pre-test before they ever write a line of code...</description>
		<content:encoded><![CDATA[<p>That coddinghorror article is a good one I hadn&#8217;t read &#8212; thanks for pointing out.  Now I&#8217;m curious to give my students a pre-test before they ever write a line of code&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hélène Martin</title>
		<link>http://www.helenemartin.com/2009-12-conditionals/comment-page-1/#comment-55</link>
		<dc:creator>Hélène Martin</dc:creator>
		<pubDate>Sun, 06 Dec 2009 01:51:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.helenemartin.com/?p=261#comment-55</guid>
		<description>Yes!  I find it fascinating.  

I didn&#039;t expect such stark differences on what I considered a pretty uninteresting question...</description>
		<content:encoded><![CDATA[<p>Yes!  I find it fascinating.  </p>
<p>I didn&#8217;t expect such stark differences on what I considered a pretty uninteresting question&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lauren Bricker</title>
		<link>http://www.helenemartin.com/2009-12-conditionals/comment-page-1/#comment-54</link>
		<dc:creator>Lauren Bricker</dc:creator>
		<pubDate>Fri, 04 Dec 2009 21:06:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.helenemartin.com/?p=261#comment-54</guid>
		<description>I&#039;m sure you&#039;ve seen Stuart&#039;s stuff on the mystery of b := (b = false) right? http://www.cs.washington.edu/homes/reges/mystery/</description>
		<content:encoded><![CDATA[<p>I&#8217;m sure you&#8217;ve seen Stuart&#8217;s stuff on the mystery of b := (b = false) right? <a href="http://www.cs.washington.edu/homes/reges/mystery/" rel="nofollow">http://www.cs.washington.edu/homes/reges/mystery/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anton</title>
		<link>http://www.helenemartin.com/2009-12-conditionals/comment-page-1/#comment-53</link>
		<dc:creator>Anton</dc:creator>
		<pubDate>Thu, 03 Dec 2009 05:32:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.helenemartin.com/?p=261#comment-53</guid>
		<description>&quot;I pretty much could give this one problem and assign grades for the year.&quot;

Yup. You&#039;re differentiating between the good and the excellent, but the gap is even wider between those who get programming and those who don&#039;t, and the test to distinguish between the two isn&#039;t very complicated: http://www.codinghorror.com/blog/archives/000635.html

This gap persists at all skill levels by the way. The difference between an average professional programmer and an excellent one is immense. We see this all the time when giving take-home programming assignments during interviews. The results that come back invariably fall into one of three buckets: unacceptable, average or fantastic.</description>
		<content:encoded><![CDATA[<p>&#8220;I pretty much could give this one problem and assign grades for the year.&#8221;</p>
<p>Yup. You&#8217;re differentiating between the good and the excellent, but the gap is even wider between those who get programming and those who don&#8217;t, and the test to distinguish between the two isn&#8217;t very complicated: <a href="http://www.codinghorror.com/blog/archives/000635.html" rel="nofollow">http://www.codinghorror.com/blog/archives/000635.html</a></p>
<p>This gap persists at all skill levels by the way. The difference between an average professional programmer and an excellent one is immense. We see this all the time when giving take-home programming assignments during interviews. The results that come back invariably fall into one of three buckets: unacceptable, average or fantastic.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hélène Martin</title>
		<link>http://www.helenemartin.com/2009-12-conditionals/comment-page-1/#comment-52</link>
		<dc:creator>Hélène Martin</dc:creator>
		<pubDate>Thu, 03 Dec 2009 01:52:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.helenemartin.com/?p=261#comment-52</guid>
		<description>Oh, absolutely.  I didn&#039;t mark them down or anything... and I wouldn&#039;t judge them as !strong based on the answer.  That&#039;s why I&#039;m surprised at how predictive the question is.  Students I know as strong gave the second answer and students I know as middle or weak gave the first.  Systematically.</description>
		<content:encoded><![CDATA[<p>Oh, absolutely.  I didn&#8217;t mark them down or anything&#8230; and I wouldn&#8217;t judge them as !strong based on the answer.  That&#8217;s why I&#8217;m surprised at how predictive the question is.  Students I know as strong gave the second answer and students I know as middle or weak gave the first.  Systematically.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: C</title>
		<link>http://www.helenemartin.com/2009-12-conditionals/comment-page-1/#comment-51</link>
		<dc:creator>C</dc:creator>
		<pubDate>Thu, 03 Dec 2009 01:45:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.helenemartin.com/?p=261#comment-51</guid>
		<description>looks like the supposedly !strong students were just explicit, and did exactly what you asked.  Answer correctly first, and quickly in a test situation, optimize later.</description>
		<content:encoded><![CDATA[<p>looks like the supposedly !strong students were just explicit, and did exactly what you asked.  Answer correctly first, and quickly in a test situation, optimize later.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
