<?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: Useless code</title>
	<atom:link href="http://www.losingfight.com/blog/2007/05/08/useless-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.losingfight.com/blog/2007/05/08/useless-code/</link>
	<description>try the veal</description>
	<pubDate>Wed, 20 Aug 2008 14:14:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Uli Kusterer</title>
		<link>http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-17687</link>
		<dc:creator>Uli Kusterer</dc:creator>
		<pubDate>Tue, 22 May 2007 09:20:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-17687</guid>
		<description>Maybe the programmer just needed a place to set a breakpoint on? This is essentially a no-op, but it still compiles to something. If this is a place where he needs to break often during debugging (i.e. it was some sort of main entry point or bottleneck), he'll be happy if he can just uncomment this thing, put a breakpoint next to it and get debugging.

And maybe one programmer put this code there, and another came by, thought: "What's the point of this? I'll comment it out and ask Jeff why he did that!" And that's how it happened. If nobody had to debug this spot recently, it may have just not been uncommented again.

I could see dozens of reasons for such a statement, all perfectly valid.</description>
		<content:encoded><![CDATA[<p>Maybe the programmer just needed a place to set a breakpoint on? This is essentially a no-op, but it still compiles to something. If this is a place where he needs to break often during debugging (i.e. it was some sort of main entry point or bottleneck), he&#8217;ll be happy if he can just uncomment this thing, put a breakpoint next to it and get debugging.</p>
<p>And maybe one programmer put this code there, and another came by, thought: &#8220;What&#8217;s the point of this? I&#8217;ll comment it out and ask Jeff why he did that!&#8221; And that&#8217;s how it happened. If nobody had to debug this spot recently, it may have just not been uncommented again.</p>
<p>I could see dozens of reasons for such a statement, all perfectly valid.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Grynspan</title>
		<link>http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-16571</link>
		<dc:creator>Jonathan Grynspan</dc:creator>
		<pubDate>Sat, 12 May 2007 03:14:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-16571</guid>
		<description>It's possible that, at some point in the development cycle, a complex expression was in the place of that "1", as well as in other places. As the program evolved, the expression became obsolete and a clever developer decided to replace all instances with "1" to avoid having to modify logic or redo unit testing.

It's a bit of a stretch, but one can hope that the developer was not so blatantly dumb.</description>
		<content:encoded><![CDATA[<p>It&#8217;s possible that, at some point in the development cycle, a complex expression was in the place of that &#8220;1&#8243;, as well as in other places. As the program evolved, the expression became obsolete and a clever developer decided to replace all instances with &#8220;1&#8243; to avoid having to modify logic or redo unit testing.</p>
<p>It&#8217;s a bit of a stretch, but one can hope that the developer was not so blatantly dumb.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George Sudarkoff</title>
		<link>http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-16062</link>
		<dc:creator>George Sudarkoff</dc:creator>
		<pubDate>Wed, 09 May 2007 05:28:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-16062</guid>
		<description>You want to see HUGE functions? Look at this: http://george.sudarkoff.com/2007/02/_how_many_problems_can.html</description>
		<content:encoded><![CDATA[<p>You want to see HUGE functions? Look at this: <a href="http://george.sudarkoff.com/2007/02/_how_many_problems_can.html" rel="nofollow">http://george.sudarkoff.com/2007/02/_how_many_problems_can.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Goh</title>
		<link>http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-16061</link>
		<dc:creator>Joe Goh</dc:creator>
		<pubDate>Wed, 09 May 2007 05:23:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-16061</guid>
		<description>"Where is there loads of code in a switch-case in the first place?"

Oops, should be "Why" instead of "Where".</description>
		<content:encoded><![CDATA[<p>&#8220;Where is there loads of code in a switch-case in the first place?&#8221;</p>
<p>Oops, should be &#8220;Why&#8221; instead of &#8220;Where&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Goh</title>
		<link>http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-16060</link>
		<dc:creator>Joe Goh</dc:creator>
		<pubDate>Wed, 09 May 2007 05:21:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-16060</guid>
		<description>In my previous full-time job before this startup, i've seen quite a few scary bits of useless code too.

else clauses with no code inside.

switch-case statements with LOTS of unreachable code following a break statement, which makes you really, really scared.  Where is there loads of code in a switch-case in the first place?  Ahhh, that's a much longer story for another day.

Lots of "legacy functions" that nothing is calling anymore.  And these functions are HUGE (more than 150 lines for sure).

Life as a maintenance programmer is good.</description>
		<content:encoded><![CDATA[<p>In my previous full-time job before this startup, i&#8217;ve seen quite a few scary bits of useless code too.</p>
<p>else clauses with no code inside.</p>
<p>switch-case statements with LOTS of unreachable code following a break statement, which makes you really, really scared.  Where is there loads of code in a switch-case in the first place?  Ahhh, that&#8217;s a much longer story for another day.</p>
<p>Lots of &#8220;legacy functions&#8221; that nothing is calling anymore.  And these functions are HUGE (more than 150 lines for sure).</p>
<p>Life as a maintenance programmer is good.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George Sudarkoff</title>
		<link>http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-16057</link>
		<dc:creator>George Sudarkoff</dc:creator>
		<pubDate>Wed, 09 May 2007 05:02:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-16057</guid>
		<description>We all have our own little moments (and idiosyncrasies). Sometimes, especially when you are chasing after a particularly illusive bug, such small reassurances of things still being generally sane might help you not to loose it completely.

Or maybe it's a reminder for something. Or a case of careless find and replace. Or a result of some script running. Or this is a custom ASSERT that does more than you think. I mean, who knows? Don't be so quick to judge. :)</description>
		<content:encoded><![CDATA[<p>We all have our own little moments (and idiosyncrasies). Sometimes, especially when you are chasing after a particularly illusive bug, such small reassurances of things still being generally sane might help you not to loose it completely.</p>
<p>Or maybe it&#8217;s a reminder for something. Or a case of careless find and replace. Or a result of some script running. Or this is a custom ASSERT that does more than you think. I mean, who knows? Don&#8217;t be so quick to judge. <img src='http://www.losingfight.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Goh</title>
		<link>http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-16038</link>
		<dc:creator>Joe Goh</dc:creator>
		<pubDate>Wed, 09 May 2007 02:34:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-16038</guid>
		<description>Ooops, that's right.  Serves me right for replying to blogs 10 mins after waking up. :-)

Hmm, in that case, I have no idea why he wrote that line.  If the original coder is still around, perhaps you should ask him (nicely).</description>
		<content:encoded><![CDATA[<p>Ooops, that&#8217;s right.  Serves me right for replying to blogs 10 mins after waking up. <img src='http://www.losingfight.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Hmm, in that case, I have no idea why he wrote that line.  If the original coder is still around, perhaps you should ask him (nicely).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-16031</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Wed, 09 May 2007 02:08:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-16031</guid>
		<description>Well, ASSERT(1) would _never_ fire, where had he done ASSERT(0), that would fire all the time. 

And like you said, ASSERTs that fire all the time can be useful (i.e. if you reach a code flow that shouldn't ever be reached).</description>
		<content:encoded><![CDATA[<p>Well, ASSERT(1) would _never_ fire, where had he done ASSERT(0), that would fire all the time. </p>
<p>And like you said, ASSERTs that fire all the time can be useful (i.e. if you reach a code flow that shouldn&#8217;t ever be reached).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Goh</title>
		<link>http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-16025</link>
		<dc:creator>Joe Goh</dc:creator>
		<pubDate>Wed, 09 May 2007 01:25:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-16025</guid>
		<description>There could be another reason why he chose to do ASSERT(1) - to make sure that assertions are not compiled in the release build, or some other reason where he would want assertions to trigger everytime.  Is this ASSERT(1) in the -init method?

The good news though is that at least he uses ASSERT().  I've known quiite a few coders in the past who have not even heard of the concept.</description>
		<content:encoded><![CDATA[<p>There could be another reason why he chose to do ASSERT(1) - to make sure that assertions are not compiled in the release build, or some other reason where he would want assertions to trigger everytime.  Is this ASSERT(1) in the -init method?</p>
<p>The good news though is that at least he uses ASSERT().  I&#8217;ve known quiite a few coders in the past who have not even heard of the concept.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-16023</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Wed, 09 May 2007 01:07:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-16023</guid>
		<description>Oh, I have Worse Than Failure (the new name) in my RSS feed. :-)</description>
		<content:encoded><![CDATA[<p>Oh, I have Worse Than Failure (the new name) in my RSS feed. <img src='http://www.losingfight.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 4.698 seconds -->
