<?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: Abstraction: The Rule Of Three</title>
	<atom:link href="http://lostechies.com/derickbailey/2012/10/31/abstraction-the-rule-of-three/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/derickbailey/2012/10/31/abstraction-the-rule-of-three/</link>
	<description>Better Than Yesterday</description>
	<lastBuildDate>Fri, 17 May 2013 03:30:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: UKB</title>
		<link>http://lostechies.com/derickbailey/2012/10/31/abstraction-the-rule-of-three/#comment-2943</link>
		<dc:creator>UKB</dc:creator>
		<pubDate>Sun, 16 Dec 2012 23:48:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1021#comment-2943</guid>
		<description>1, 2, 3 could be add the previous two numbers together so that isn&#039;t completely accurate either</description>
		<content:encoded><![CDATA[<p>1, 2, 3 could be add the previous two numbers together so that isn&#8217;t completely accurate either</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Young</title>
		<link>http://lostechies.com/derickbailey/2012/10/31/abstraction-the-rule-of-three/#comment-2829</link>
		<dc:creator>Andrew Young</dc:creator>
		<pubDate>Mon, 05 Nov 2012 21:36:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1021#comment-2829</guid>
		<description>Two points make a line. Third point validates it.</description>
		<content:encoded><![CDATA[<p>Two points make a line. Third point validates it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Sutton</title>
		<link>http://lostechies.com/derickbailey/2012/10/31/abstraction-the-rule-of-three/#comment-2826</link>
		<dc:creator>Dan Sutton</dc:creator>
		<pubDate>Fri, 02 Nov 2012 16:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1021#comment-2826</guid>
		<description>There&#039;s something missing here, and that&#039;s the concept of what the code is going to be used for, and, more importantly, how it&#039;s going to be called.

Here&#039;s an example of what I&#039;m talking about: imagine you&#039;ve got a class which ships packages via the US Mail, and another one which ships packages via FedEx. Conceptually, they&#039;re going to be similar; internally they&#039;re going to be different. 

Now, if different software is going to use each class, then it&#039;s OK to keep them separated with occasional duplication. But if you&#039;re going to create something which expects an object of type &quot;shipper&quot; then you&#039;re going to want to make an abstract class (or an interface) which contains empty methods to perform any shipper function, and subclass the US Mail and FedEx classes from it. Of course, you&#039;re going to find parts which contain identical code, and by all means, those parts should be defined in the abstract superclass. 

But my point is that any decision you make about how to abstract the code should be informed by the requirements of what&#039;s going to call it. It&#039;s all very well to throw things around like DRY and YAGNI, but in the end, what counts is common sense.</description>
		<content:encoded><![CDATA[<p>There&#8217;s something missing here, and that&#8217;s the concept of what the code is going to be used for, and, more importantly, how it&#8217;s going to be called.</p>
<p>Here&#8217;s an example of what I&#8217;m talking about: imagine you&#8217;ve got a class which ships packages via the US Mail, and another one which ships packages via FedEx. Conceptually, they&#8217;re going to be similar; internally they&#8217;re going to be different. </p>
<p>Now, if different software is going to use each class, then it&#8217;s OK to keep them separated with occasional duplication. But if you&#8217;re going to create something which expects an object of type &#8220;shipper&#8221; then you&#8217;re going to want to make an abstract class (or an interface) which contains empty methods to perform any shipper function, and subclass the US Mail and FedEx classes from it. Of course, you&#8217;re going to find parts which contain identical code, and by all means, those parts should be defined in the abstract superclass. </p>
<p>But my point is that any decision you make about how to abstract the code should be informed by the requirements of what&#8217;s going to call it. It&#8217;s all very well to throw things around like DRY and YAGNI, but in the end, what counts is common sense.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: imnotsayinimjustsayin</title>
		<link>http://lostechies.com/derickbailey/2012/10/31/abstraction-the-rule-of-three/#comment-2825</link>
		<dc:creator>imnotsayinimjustsayin</dc:creator>
		<pubDate>Fri, 02 Nov 2012 15:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1021#comment-2825</guid>
		<description>1,2,3,1,5,7,1,11,13,...</description>
		<content:encoded><![CDATA[<p>1,2,3,1,5,7,1,11,13,&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joshuaflanagan</title>
		<link>http://lostechies.com/derickbailey/2012/10/31/abstraction-the-rule-of-three/#comment-2824</link>
		<dc:creator>joshuaflanagan</dc:creator>
		<pubDate>Fri, 02 Nov 2012 14:07:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1021#comment-2824</guid>
		<description>One could certainly do some mental gymnastics to make the situation fit the definition, but it only dilutes the intent of the DRY principle.
I think what you are looking for is Once and Only Once:
http://c2.com/xp/OnceAndOnlyOnce.html</description>
		<content:encoded><![CDATA[<p>One could certainly do some mental gymnastics to make the situation fit the definition, but it only dilutes the intent of the DRY principle.<br />
I think what you are looking for is Once and Only Once:<br />
<a href="http://c2.com/xp/OnceAndOnlyOnce.html" rel="nofollow">http://c2.com/xp/OnceAndOnlyOnce.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alejandro Varela</title>
		<link>http://lostechies.com/derickbailey/2012/10/31/abstraction-the-rule-of-three/#comment-2823</link>
		<dc:creator>Alejandro Varela</dc:creator>
		<pubDate>Fri, 02 Nov 2012 13:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1021#comment-2823</guid>
		<description>damn true</description>
		<content:encoded><![CDATA[<p>damn true</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://lostechies.com/derickbailey/2012/10/31/abstraction-the-rule-of-three/#comment-2822</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Fri, 02 Nov 2012 08:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1021#comment-2822</guid>
		<description>The piece of knowledge that is being duplicated in the example is that the value &quot;bar&quot; should be handled differently then any other value.</description>
		<content:encoded><![CDATA[<p>The piece of knowledge that is being duplicated in the example is that the value &#8220;bar&#8221; should be handled differently then any other value.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nerd</title>
		<link>http://lostechies.com/derickbailey/2012/10/31/abstraction-the-rule-of-three/#comment-2821</link>
		<dc:creator>nerd</dc:creator>
		<pubDate>Thu, 01 Nov 2012 21:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1021#comment-2821</guid>
		<description>When looking at 1,2,3... I can think of millions of valid patterns, e.g. f(n) = round(3*f(n-1)/2), which gives: 5,8,12,18,27... Or f(n) = f(n-1)+f(n-2)...
One can show that there are unlimited number of patterns to continue any limiter sequence of numbers.</description>
		<content:encoded><![CDATA[<p>When looking at 1,2,3&#8230; I can think of millions of valid patterns, e.g. f(n) = round(3*f(n-1)/2), which gives: 5,8,12,18,27&#8230; Or f(n) = f(n-1)+f(n-2)&#8230;<br />
One can show that there are unlimited number of patterns to continue any limiter sequence of numbers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris Garcia</title>
		<link>http://lostechies.com/derickbailey/2012/10/31/abstraction-the-rule-of-three/#comment-2820</link>
		<dc:creator>Kris Garcia</dc:creator>
		<pubDate>Thu, 01 Nov 2012 20:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1021#comment-2820</guid>
		<description>Good stuff. Definitely resonates with me. Code is knowledge, so I think the DRY principle does apply to lines of code. Plus, it seems to me that part of the problem that the Rule of Three heuristic can help address is to determine whether a line of code is JUST SIMILAR to another line of code as opposed to ACTUALLY REPEATING the same concept. As time goes by the two lines may diverge and so it makes sense to delay abstraction until pragmatism demands it (which reminds me of &lt;a href=&quot;//www.codinghorror.com/blog/2006/10/the-last-responsible-moment.html”&quot; rel=&quot;nofollow&quot;&gt;The Last Responsible Moment&lt;/a&gt;).</description>
		<content:encoded><![CDATA[<p>Good stuff. Definitely resonates with me. Code is knowledge, so I think the DRY principle does apply to lines of code. Plus, it seems to me that part of the problem that the Rule of Three heuristic can help address is to determine whether a line of code is JUST SIMILAR to another line of code as opposed to ACTUALLY REPEATING the same concept. As time goes by the two lines may diverge and so it makes sense to delay abstraction until pragmatism demands it (which reminds me of <a href="//www.codinghorror.com/blog/2006/10/the-last-responsible-moment.html”" rel="nofollow">The Last Responsible Moment</a>).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leonardo Pisano</title>
		<link>http://lostechies.com/derickbailey/2012/10/31/abstraction-the-rule-of-three/#comment-2818</link>
		<dc:creator>Leonardo Pisano</dc:creator>
		<pubDate>Thu, 01 Nov 2012 12:49:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1021#comment-2818</guid>
		<description>For that matter: 1,2,3,5,8,13.</description>
		<content:encoded><![CDATA[<p>For that matter: 1,2,3,5,8,13.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
