<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Code duplication, cheap but not free</title>
	<atom:link href="http://blog.timbunce.org/2008/03/25/code-duplication-cheap-but-not-free/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.timbunce.org/2008/03/25/code-duplication-cheap-but-not-free/</link>
	<description>Listen. Reflect. Explore. Solve.</description>
	<lastBuildDate>Sun, 14 Apr 2013 08:36:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: TimBunce</title>
		<link>http://blog.timbunce.org/2008/03/25/code-duplication-cheap-but-not-free/#comment-126</link>
		<dc:creator><![CDATA[TimBunce]]></dc:creator>
		<pubDate>Fri, 18 Apr 2008 21:24:04 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=27#comment-126</guid>
		<description><![CDATA[You&#039;re right of course Adam.

I do use unless occasionally, but only when it reads much more naturally than any alternative, and when the conditional expression is trivial. So in this case I certainly broke the second part of my own guidelines, and I probably broke the first as well.

When I&#039;m trying to avoid an &#039;unless&#039; I find myself using &#039;not&#039; more than &#039;!&#039; these days. So I&#039;d probably write the expression as

    next if not $x or $x-&gt;{as_of_rev} ...]]></description>
		<content:encoded><![CDATA[<p>You&#8217;re right of course Adam.</p>
<p>I do use unless occasionally, but only when it reads much more naturally than any alternative, and when the conditional expression is trivial. So in this case I certainly broke the second part of my own guidelines, and I probably broke the first as well.</p>
<p>When I&#8217;m trying to avoid an &#8216;unless&#8217; I find myself using &#8216;not&#8217; more than &#8216;!&#8217; these days. So I&#8217;d probably write the expression as</p>
<p>    next if not $x or $x-&gt;{as_of_rev} &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam Kaplan</title>
		<link>http://blog.timbunce.org/2008/03/25/code-duplication-cheap-but-not-free/#comment-125</link>
		<dc:creator><![CDATA[Adam Kaplan]]></dc:creator>
		<pubDate>Fri, 18 Apr 2008 12:54:03 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=27#comment-125</guid>
		<description><![CDATA[&quot;I think the combined effect of changing from an ‘if’ to a ‘next’ with an ‘unless’ threw me off. Like a double negative.&quot;

Perl Best Practices, page 96 &amp; 97.  Don&#039;t use postfix-style modifiers other than if, and never use unless.

I point that out only because you recommended that I read the book just 3 weeks ago  (I did, and this is exactly what it said could happen).  I do think the next belongs on the left though.

Cheers
adam]]></description>
		<content:encoded><![CDATA[<p>&#8220;I think the combined effect of changing from an ‘if’ to a ‘next’ with an ‘unless’ threw me off. Like a double negative.&#8221;</p>
<p>Perl Best Practices, page 96 &amp; 97.  Don&#8217;t use postfix-style modifiers other than if, and never use unless.</p>
<p>I point that out only because you recommended that I read the book just 3 weeks ago  (I did, and this is exactly what it said could happen).  I do think the next belongs on the left though.</p>
<p>Cheers<br />
adam</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BKB</title>
		<link>http://blog.timbunce.org/2008/03/25/code-duplication-cheap-but-not-free/#comment-107</link>
		<dc:creator><![CDATA[BKB]]></dc:creator>
		<pubDate>Sun, 06 Apr 2008 14:53:41 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=27#comment-107</guid>
		<description><![CDATA[I saw something rather similar here on Wordpress recently:
http://nsaunders.wordpress.com/2008/02/27/how-to-map-protein-sequence-onto-chromosomal-coordinates-using-bioperl/]]></description>
		<content:encoded><![CDATA[<p>I saw something rather similar here on WordPress recently:<br />
<a href="http://nsaunders.wordpress.com/2008/02/27/how-to-map-protein-sequence-onto-chromosomal-coordinates-using-bioperl/" rel="nofollow">http://nsaunders.wordpress.com/2008/02/27/how-to-map-protein-sequence-onto-chromosomal-coordinates-using-bioperl/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Lembark</title>
		<link>http://blog.timbunce.org/2008/03/25/code-duplication-cheap-but-not-free/#comment-100</link>
		<dc:creator><![CDATA[Steve Lembark]]></dc:creator>
		<pubDate>Wed, 26 Mar 2008 13:17:20 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=27#comment-100</guid>
		<description><![CDATA[One thing that helps me in these cases: I usually write a comment something like:

# at this point $current_revision is &gt; $x, save the first one.

then stick the &#039;next&#039; above the comment. That gives me a reference for 
the if/or/unless/and logic -- and makes it easier for whomever follows
me to see if I did it right!]]></description>
		<content:encoded><![CDATA[<p>One thing that helps me in these cases: I usually write a comment something like:</p>
<p># at this point $current_revision is &gt; $x, save the first one.</p>
<p>then stick the &#8216;next&#8217; above the comment. That gives me a reference for<br />
the if/or/unless/and logic &#8212; and makes it easier for whomever follows<br />
me to see if I did it right!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sxoop</title>
		<link>http://blog.timbunce.org/2008/03/25/code-duplication-cheap-but-not-free/#comment-98</link>
		<dc:creator><![CDATA[sxoop]]></dc:creator>
		<pubDate>Tue, 25 Mar 2008 23:39:38 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=27#comment-98</guid>
		<description><![CDATA[htmlize ( http://www.emacswiki.org/cgi-bin/wiki/Htmlize ) is quite good for pasting syntax-highlighted code from Emacs to the web.]]></description>
		<content:encoded><![CDATA[<p>htmlize ( <a href="http://www.emacswiki.org/cgi-bin/wiki/Htmlize" rel="nofollow">http://www.emacswiki.org/cgi-bin/wiki/Htmlize</a> ) is quite good for pasting syntax-highlighted code from Emacs to the web.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TimBunce</title>
		<link>http://blog.timbunce.org/2008/03/25/code-duplication-cheap-but-not-free/#comment-97</link>
		<dc:creator><![CDATA[TimBunce]]></dc:creator>
		<pubDate>Tue, 25 Mar 2008 19:02:49 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=27#comment-97</guid>
		<description><![CDATA[Yes, $x was a cop out. In my defence I&#039;m not familiar enough with that part of the system to come up with a name I could be sure of, $x is at least obviously abstract, and it only has a 3 line scope,

I opted not to factor out the “-&gt;{ $args{cid} }” because it didn&#039;t seem worth digging deeper into the data structure for the very small gain (relative to avoiding calls to get_data). If I need to revisit the code again for performance reasons I&#039;d change it.

My mistake? The &quot;&gt; $current_revision&quot; should have been &quot;&lt;= $current_revision&quot;. I think the combined effect of changing from an &#039;if&#039; to a &#039;next&#039; with an &#039;unless&#039; threw me off. Like a double negative.]]></description>
		<content:encoded><![CDATA[<p>Yes, $x was a cop out. In my defence I&#8217;m not familiar enough with that part of the system to come up with a name I could be sure of, $x is at least obviously abstract, and it only has a 3 line scope,</p>
<p>I opted not to factor out the “-&gt;{ $args{cid} }” because it didn&#8217;t seem worth digging deeper into the data structure for the very small gain (relative to avoiding calls to get_data). If I need to revisit the code again for performance reasons I&#8217;d change it.</p>
<p>My mistake? The &#8220;&gt; $current_revision&#8221; should have been &#8220;&lt;= $current_revision&#8221;. I think the combined effect of changing from an &#8216;if&#8217; to a &#8216;next&#8217; with an &#8216;unless&#8217; threw me off. Like a double negative.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Perl Coding School &#187; Blog Archive &#187; perl code [2008-03-25 18:44:05]</title>
		<link>http://blog.timbunce.org/2008/03/25/code-duplication-cheap-but-not-free/#comment-96</link>
		<dc:creator><![CDATA[Perl Coding School &#187; Blog Archive &#187; perl code [2008-03-25 18:44:05]]]></dc:creator>
		<pubDate>Tue, 25 Mar 2008 18:51:52 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=27#comment-96</guid>
		<description><![CDATA[[...]  Code duplication, cheap but not free  By TimBunce  I wonder if my sensitivity to code duplication is partly due to needing to pay code attention to efficiency for most of my career. (I started Perl programming about 15 years ago, when cpu performance was measured in MHz.) &#8230;   Not this&#8230; - http://blog.timbunce.org [...]]]></description>
		<content:encoded><![CDATA[<p>[...]  Code duplication, cheap but not free  By TimBunce  I wonder if my sensitivity to code duplication is partly due to needing to pay code attention to efficiency for most of my career. (I started Perl programming about 15 years ago, when cpu performance was measured in MHz.) &#8230;   Not this&#8230; &#8211; <a href="http://blog.timbunce.org" rel="nofollow">http://blog.timbunce.org</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Rolsky</title>
		<link>http://blog.timbunce.org/2008/03/25/code-duplication-cheap-but-not-free/#comment-95</link>
		<dc:creator><![CDATA[Dave Rolsky]]></dc:creator>
		<pubDate>Tue, 25 Mar 2008 16:49:24 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=27#comment-95</guid>
		<description><![CDATA[A couple things. First, &quot;$x&quot;? Seriously? It must have some sort of meaning, how about giving it a real name?

Second, I think it&#039;d make more sense to extract out the &quot;-&gt;{ $args{cid} }&quot; part too. Any reason you didn&#039;t?

I&#039;m afraid I can&#039;t spot the error though. Looking at the original code is making my brane hurt so I&#039;m giving up now ;)]]></description>
		<content:encoded><![CDATA[<p>A couple things. First, &#8220;$x&#8221;? Seriously? It must have some sort of meaning, how about giving it a real name?</p>
<p>Second, I think it&#8217;d make more sense to extract out the &#8220;-&gt;{ $args{cid} }&#8221; part too. Any reason you didn&#8217;t?</p>
<p>I&#8217;m afraid I can&#8217;t spot the error though. Looking at the original code is making my brane hurt so I&#8217;m giving up now ;)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
