<?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: The Hardest Test I Ever Gave (C++)</title>
	<atom:link href="http://lbrandy.com/blog/2008/11/the-hardest-test-i-ever-gave-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://lbrandy.com/blog/2008/11/the-hardest-test-i-ever-gave-c/</link>
	<description>{ on programming and the internets, every monday }</description>
	<lastBuildDate>Fri, 03 Feb 2012 14:14:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Alpheus</title>
		<link>http://lbrandy.com/blog/2008/11/the-hardest-test-i-ever-gave-c/comment-page-1/#comment-28945</link>
		<dc:creator>Alpheus</dc:creator>
		<pubDate>Mon, 02 Jan 2012 18:30:58 +0000</pubDate>
		<guid isPermaLink="false">http://lbrandy.com/blog/?p=283#comment-28945</guid>
		<description>Oddly enough, my reaction to this wasn&#039;t just &quot;this is a bad test&quot;.  My reaction was &quot;C++ (and C as well, really) is a horrible language.&quot;

Of course, my feelings about this are probably a result of being a mathematician, and not a programmer, and of having lost patience with artificial complexity.   These days, I cannot motivate myself to learn the dark secrets of C++ or Perl.  Currently, I use Python for my work, and I&#039;m trying to learn Common Lisp--and both these languages are a lot &quot;cleaner&quot; than C++ or Perl.

Having said that, even those languages have their &quot;gotchas&quot;.  I&#039;d like to make a cleaner, more portable version of Common Lisp...but, now that I think about it, I&#039;m beginning to wonder if it&#039;s impossible to design a language without &quot;gotchas&quot;!</description>
		<content:encoded><![CDATA[<p>Oddly enough, my reaction to this wasn&#8217;t just &#8220;this is a bad test&#8221;.  My reaction was &#8220;C++ (and C as well, really) is a horrible language.&#8221;</p>
<p>Of course, my feelings about this are probably a result of being a mathematician, and not a programmer, and of having lost patience with artificial complexity.   These days, I cannot motivate myself to learn the dark secrets of C++ or Perl.  Currently, I use Python for my work, and I&#8217;m trying to learn Common Lisp&#8211;and both these languages are a lot &#8220;cleaner&#8221; than C++ or Perl.</p>
<p>Having said that, even those languages have their &#8220;gotchas&#8221;.  I&#8217;d like to make a cleaner, more portable version of Common Lisp&#8230;but, now that I think about it, I&#8217;m beginning to wonder if it&#8217;s impossible to design a language without &#8220;gotchas&#8221;!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: olfat</title>
		<link>http://lbrandy.com/blog/2008/11/the-hardest-test-i-ever-gave-c/comment-page-1/#comment-28244</link>
		<dc:creator>olfat</dc:creator>
		<pubDate>Fri, 10 Dec 2010 08:58:37 +0000</pubDate>
		<guid isPermaLink="false">http://lbrandy.com/blog/?p=283#comment-28244</guid>
		<description>question 1e,
x = (x++ == 3 + x % (x=x=3))
% is the first to evaluate, expression inside (x=x=3) is evaluated first causing x to equal 3.
then x% (3 ) is evaluated returning 1
then the + is evaluated returning 4
(x == 4) is evaluated returning 0
finally ++ is evaluated causing x to equal to 1</description>
		<content:encoded><![CDATA[<p>question 1e,<br />
x = (x++ == 3 + x % (x=x=3))<br />
% is the first to evaluate, expression inside (x=x=3) is evaluated first causing x to equal 3.<br />
then x% (3 ) is evaluated returning 1<br />
then the + is evaluated returning 4<br />
(x == 4) is evaluated returning 0<br />
finally ++ is evaluated causing x to equal to 1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pierre</title>
		<link>http://lbrandy.com/blog/2008/11/the-hardest-test-i-ever-gave-c/comment-page-1/#comment-1031</link>
		<dc:creator>pierre</dc:creator>
		<pubDate>Tue, 25 Nov 2008 13:01:24 +0000</pubDate>
		<guid isPermaLink="false">http://lbrandy.com/blog/?p=283#comment-1031</guid>
		<description>I think you&#039;ve confused puzzles with education.

I&#039;ve been programming since 1965, and I wouldn&#039;t waste two minutes on trying to unravel these conundrums.

First, they will render differently depending on the compiler.

Second, why rack your brain when you can just compile them and let the compiler do the work for you.

Third, anyone writing like this in production code would get [A] a stern warning and then [B] fired.</description>
		<content:encoded><![CDATA[<p>I think you&#8217;ve confused puzzles with education.</p>
<p>I&#8217;ve been programming since 1965, and I wouldn&#8217;t waste two minutes on trying to unravel these conundrums.</p>
<p>First, they will render differently depending on the compiler.</p>
<p>Second, why rack your brain when you can just compile them and let the compiler do the work for you.</p>
<p>Third, anyone writing like this in production code would get [A] a stern warning and then [B] fired.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sven Callaerts</title>
		<link>http://lbrandy.com/blog/2008/11/the-hardest-test-i-ever-gave-c/comment-page-1/#comment-1030</link>
		<dc:creator>Sven Callaerts</dc:creator>
		<pubDate>Tue, 25 Nov 2008 08:52:53 +0000</pubDate>
		<guid isPermaLink="false">http://lbrandy.com/blog/?p=283#comment-1030</guid>
		<description>I agree with Mark Richards in that I don&#039;t see the use of these kind of tests (either in education or in job tests). It&#039;s the equivalent of those spelling tests where you have to spell words that are never used in real live (except when you do spelling contests). Some people might enjoy figuring out what the result of 3x+++%12^--45 is, but it proves nothing except that those people have nothing better to do.</description>
		<content:encoded><![CDATA[<p>I agree with Mark Richards in that I don&#8217;t see the use of these kind of tests (either in education or in job tests). It&#8217;s the equivalent of those spelling tests where you have to spell words that are never used in real live (except when you do spelling contests). Some people might enjoy figuring out what the result of 3x+++%12^&#8211;45 is, but it proves nothing except that those people have nothing better to do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CH Gowri Kumar</title>
		<link>http://lbrandy.com/blog/2008/11/the-hardest-test-i-ever-gave-c/comment-page-1/#comment-1029</link>
		<dc:creator>CH Gowri Kumar</dc:creator>
		<pubDate>Tue, 25 Nov 2008 08:09:44 +0000</pubDate>
		<guid isPermaLink="false">http://lbrandy.com/blog/?p=283#comment-1029</guid>
		<description>You might be interested in my collection of these sort of questions as well:-)
http://www.gowrikumar.com/c/index.html</description>
		<content:encoded><![CDATA[<p>You might be interested in my collection of these sort of questions as well:-)<br />
<a href="http://www.gowrikumar.com/c/index.html" rel="nofollow">http://www.gowrikumar.com/c/index.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CPP</title>
		<link>http://lbrandy.com/blog/2008/11/the-hardest-test-i-ever-gave-c/comment-page-1/#comment-1028</link>
		<dc:creator>CPP</dc:creator>
		<pubDate>Tue, 25 Nov 2008 05:58:24 +0000</pubDate>
		<guid isPermaLink="false">http://lbrandy.com/blog/?p=283#comment-1028</guid>
		<description>Question (1e) is undefined, since it has the expression &quot;x = x++&quot;.</description>
		<content:encoded><![CDATA[<p>Question (1e) is undefined, since it has the expression &#8220;x = x++&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pedro</title>
		<link>http://lbrandy.com/blog/2008/11/the-hardest-test-i-ever-gave-c/comment-page-1/#comment-1027</link>
		<dc:creator>Pedro</dc:creator>
		<pubDate>Tue, 25 Nov 2008 05:26:10 +0000</pubDate>
		<guid isPermaLink="false">http://lbrandy.com/blog/?p=283#comment-1027</guid>
		<description>@Tim: &#039;5//3&#039; is as valid an expression as &#039;5 /* blah */&#039; or as &#039;6*4&#039;. The semicolon is not part of the expression. The rest of the line would be ignored but that&#039;s not relevant for it being an expression or not. The value of that expression is 5. Think e.g. #define n 5//3. So the answer to 2d is 5, regardless of how you &quot;make it work&quot;.</description>
		<content:encoded><![CDATA[<p>@Tim: &#8217;5//3&#8242; is as valid an expression as &#8217;5 /* blah */&#8217; or as &#8217;6*4&#8242;. The semicolon is not part of the expression. The rest of the line would be ignored but that&#8217;s not relevant for it being an expression or not. The value of that expression is 5. Think e.g. #define n 5//3. So the answer to 2d is 5, regardless of how you &#8220;make it work&#8221;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

