<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Object Mentor Blog: The Bloat at the Edge of Duplication Removal (The Orange Model)</title>
    <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>The Bloat at the Edge of Duplication Removal (The Orange Model)</title>
      <description>&lt;p&gt;
There are times when I sit down to work on some piece of code and I see a bit of duplication.  I remove it. Then I see a bit more, and a bit more. When I&#8217;m done with all of my extractions, I look back at the code and notice that it&#8217;s increased in size about 20 or 30 percent.  If I&#8217;m working with someone else, it&#8217;s often a shock for them.  After all, we are used to thinking that code gets smaller when we remove duplication. Often it does, but not always.
&lt;/p&gt;

&lt;p&gt;Let&#8217;s take a look at an example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
private void adjustPaths() {
  pathNew = pathNew.removeFirstSegments(1).removeFileExtension()
                  .addFileExtension("class");
  pathOld = pathOld.removeFirstSegments(1).removeFileExtension()
                  .addFileExtension("class");
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That&amp;#8217;s six lines of code with obvious duplication.  Now let&amp;#8217;s remove it.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
private void adjustPaths() {
  pathNew = adjustPath(pathNew);
  pathOld = adjustPath(pathOld);
}

private IPath adjustPath(IPath path) {
  return path.removeFirstSegments(1).removeFileExtension()
               .addFileExtension("class");
}
&lt;/pre&gt;&lt;/code&gt;
&lt;p&gt;
Now we have 9 lines.&lt;/p&gt;
&lt;p&gt;
What&#8217;s going on here?  Well, when we extract duplication, we have to put it someplace, and that operation isn&#8217;t free.  In all languages, there is a cost in space for separate functions.  In Java, the cost includes method declaration line and lines for the curly braces.  In Python, the cost is (again) the declaration line and some whitespace to separate the function from other functions.&lt;/p&gt;

&lt;h2&gt;Code is like an Orange&lt;/h2&gt;
&lt;p&gt;The mental model I have for this is that code can be separated into two parts.  One part is structural.  It gives form to the code.  It consists of all of the cruft that we use to declare a method.  The stuff inside is the meat &#8212; the pure computational code which is held in place by the structural bits. 
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
/* cruft */ private IPath adjustPath(IPath path) { 
/* meat  */    return path.removeFirstSegments(1).removeFileExtension()
/* meat  */                .addFileExtension("class");
/* cruft */ } 
&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;This pattern is rather common.  In fact, you&#8217;ll see it in most living things.  The muscle tissue in your body (the meat) is held in place by a sheath called fascia.  The same pattern occurs in fruit and vegetables.  The pulp in an orange is held in place by fascia too, it&amp;#8217;s the white part between the sections:&lt;/p&gt;

	&lt;p&gt;&lt;a href="http://www.flickr.com/photos/92231089@N00/3289039006/" title="P2170002 by mfeathers256, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3455/3289039006_e1d1c2a3a7.jpg" width="500" height="375" alt="P2170002" /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;Here&#8217;s what duplication removal does, structurally.  It allows you to pull out redundant bits of pulp from big sections, yielding smaller sections, but the side effect is that you end up with more fascia.  Duplication removal increases the ratio of fascia to pulp.  If the amount of pulp you are able to remove exceeds the size of the fascia you introduce, the net amount of code decreases, otherwise it might increase.&lt;/p&gt;

&lt;p&gt;In general, I think that a high fascia to pulp ratio is better for maintenance.  It gives us is a higher surface area to volume ratio for our code.  This can enhance testability and make it easier to compose new software &amp;#8211; we already have smaller more understandable pieces.&lt;p&gt;

&lt;p&gt;The cost of fascia, however, can be disturbing. In the normal formatting convention for C++ a new method will give you at least 5 lines.  You need the line for the method declaration in the header, one for the definition in the source file, a line apiece for the beginning and ending braces and a newline to separate the method from next one.  In Haskell, you can get away with 2 if the method is a one-liner and you forgo type declarations. The thing to notice is that it is never zero.  There&#8217;s always some space overhead when we create a new method.  The question is whether the amount of code that we remove as duplication swamps the addition overhead or not.&lt;/p&gt;

&lt;p&gt;
We can model duplication removal this way &#8212; the number of lines T&#8217; after removing n stretches of x contiguous lines is:&lt;/p&gt;
&lt;p&gt;
T&#8217;  = T &amp;#8211; (n &amp;#8211; 1)x + c + n&lt;/p&gt;

&lt;p&gt;We start with T, the original number of lines in the program and we remove n &amp;#8211; 1 stretches of x lines.  We leave in the nth x (as the method we extract) and we add in c which is the number of lines of fascia for a method in our language.  We also add in n again since we will need to leave in a line for the call at each of the n sites where the code was originally duplicated.&lt;/p&gt;
&lt;p&gt;
According to the equation, we can end up with more code if c is large or if n and x are small.  Aggressive refactoring with a c of 3 or 4 and and an n of 2 and an x of 1 will definitely increase code size.&lt;/p&gt;
&lt;p&gt;
Again, is this bad? No, I think it&#8217;s just something to be aware of.  Removing duplication increases the ratio of fascia to pulp.  To me, it&#8217;s only annoying when I&#8217;m working in a language with a high c value.
&lt;/p&gt;</description>
      <pubDate>Tue, 17 Feb 2009 21:51:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:e1985d6a-2bb3-46b9-8491-d1085b55c5a7</guid>
      <author>Michael Feathers</author>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model</link>
      <category>Michaels Musings</category>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by Office 2010</title>
      <description>&lt;p&gt;This article is GREAT it can be EXCELLENT JOB and what a great tool!&lt;/p&gt;</description>
      <pubDate>Fri, 13 Jan 2012 20:30:44 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:aa3792c8-7c38-41f4-a323-fb09e52c4bb8</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-197756</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by sallyerma</title>
      <description>&lt;p&gt;Thanks for your marvelous posting! I actually enjoyed reading it, you will be a great author.I will ensure that I bookmark your blog and will come back in the foreseeable future. I want to encourage that you continue your great job, have a nice weekend!
&lt;a href="http://www.stylesnew.com/hairstyles/styles/layered/" rel="nofollow"&gt;layered hairstyles&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 09 Jan 2012 17:51:11 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:dca5f071-8ee9-4bcd-b147-1f8f072b2818</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-196419</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by iphone contacts backup</title>
      <description>&lt;p&gt;A better way to export the contacts from Iphone to comptuer. try it.&lt;/p&gt;</description>
      <pubDate>Sat, 07 Jan 2012 06:47:43 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:1bb30673-10dd-46a8-9304-f7e836ad32d8</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-195908</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by north face khumbu</title>
      <description>&lt;p&gt;This article is impressive,I hope that you will continue doing nice article like this.&lt;/p&gt;</description>
      <pubDate>Sat, 24 Dec 2011 07:16:17 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:df5ad139-ceb6-4ea2-8bb2-79d574e7e1d7</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-191265</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by grad school personal statement</title>
      <description>&lt;p&gt;Very impressive post. Thank you for sharing.&lt;/p&gt;</description>
      <pubDate>Fri, 23 Dec 2011 00:28:55 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:cb1808c0-ac7f-4c9a-9f59-a636a808760d</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-190544</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by christian louboutin</title>
      <description>&lt;p&gt;When I at first left a comment I clicked the &#8220;Notify me when new comments are added&#8221; checkbox and now each time a comment is added I get three notification emails with the same comment. Is there any way you can take away people from that service? Thanks a lot!&lt;/p&gt;</description>
      <pubDate>Thu, 03 Nov 2011 11:31:05 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:40fc2040-e703-4ac3-81bc-b680e3d97d53</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-167720</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by best sleep aid</title>
      <description>&lt;p&gt;When I at first left a comment I clicked the &amp;#8220;Notify me when new comments are added&amp;#8221; checkbox and now each time a comment is added I get three notification emails with the same comment. Is there any way you can take away people from that service? Thanks a lot!&lt;/p&gt;</description>
      <pubDate>Fri, 30 Sep 2011 13:14:12 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:b86fa638-087d-4f4d-bcdf-1d916f286e35</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-148619</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by african Mango dr oz</title>
      <description>&lt;p&gt;It is not hard to understand why the question of value is still raised when you consider that today?s outsourcing models have some inherent limitations that reduce the overall gains companies can achieve .&lt;/p&gt;</description>
      <pubDate>Tue, 27 Sep 2011 11:47:49 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:75905d1c-fa69-45b8-b321-e44f2c09bb67</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-146161</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by beats by dre store</title>
      <description>&lt;p&gt;omplete reading. (English isn&#8217;t my country&#8217;s language) Could I ask in places you received your sources from? Thanks!&lt;a href="http://www.drdrebeatsheadphones-australia.com" rel="nofollow"&gt;high quality headphones&lt;/a&gt;
&lt;a href="http://www.drdrebeatsheadphones-australia.com" rel="nofollow"&gt;new design headphones&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 23 Aug 2011 03:14:51 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:b982597a-d79e-40a2-945f-a3b3c6bf82f3</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-131667</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by Tiffany Sale</title>
      <description>&lt;p&gt;Thanks for the interesting story, although it did take rather a long time to complete reading. (English isn&amp;#8217;t my country&amp;#8217;s language) Could I ask in places you received your sources from? Thanks!&lt;/p&gt;</description>
      <pubDate>Tue, 05 Jul 2011 04:23:48 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:37b98866-cc66-418a-8d34-5d44ecf285a1</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-114689</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by okey oyunu oyna </title>
      <description>&lt;p&gt;great code.&lt;/p&gt;


	&lt;p&gt;internette g&#246;r&#252;nt&#252;l&#252; olarak &lt;a href="http://www.okeyoyunu-oyna.com" rel="nofollow"&gt;okey oyunu oyna&lt;/a&gt;, ger&#231;ek kisilerle tanis,
 turnuva heyecanini yasa.&lt;/p&gt;</description>
      <pubDate>Thu, 28 Apr 2011 07:03:54 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:9a65f9f6-e7f5-4db8-8222-abfe7359d42b</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-92684</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by accounting services</title>
      <description>&lt;p&gt;I wrote about a similar idea a while back&#8212;in Swedish, so I won&#8217;t bother you with a link. My hypothesis is that code with a higher ratio of fascia to pulp is often of higher quality.&lt;a href="http://www.admgroupllc.com/" rel="nofollow"&gt;accounting services&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 20 Jan 2011 10:11:38 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:a12215a7-9e7a-4f1c-a472-0cfc487027c5</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-58177</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by http://www.blacktowhiteiphone4.com</title>
      <description>&lt;p&gt;&lt;a href="http://www.blacktowhiteiphone4.com" rel="nofollow"&gt;iphone 4 white&lt;/a&gt; and iphone 4 black, which one will be more suitable for yourself? Thinking of the black iphone 4 is too ordinary, iphone 4 white will be the one to make you feel different.&lt;/p&gt;</description>
      <pubDate>Wed, 22 Dec 2010 20:52:34 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:c101db3d-4edf-48e4-a68c-a775e3860cf0</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-51170</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by Pandora </title>
      <description>&lt;p&gt;It is my favorite patter name (not favorite pattern, just name).&lt;/p&gt;</description>
      <pubDate>Thu, 02 Dec 2010 02:19:08 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:34608cad-8843-4ad9-bb0c-39c9f76042b6</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-45257</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by Get &lt;a href=&#8221;http://www.favre-jersey.com&#8221;&gt;Brett Favre Jerseys&lt;/a&gt;, &lt;a href=&#8221;http://www.favre-jersey.com&#8221;&gt;Favre Jerseys&lt;/a&gt;, Brett Favre Jerseys 60% Discount With Authentic Quality. Our supply selection of &lt;a href=&#8221;http://www.favre-jersey.com/brett-favre-m</title>
      <description>&lt;p&gt;Get &lt;a href="http://www.favre-jersey.com&#8221;" rel="nofollow"&gt;http://www.favre-jersey.com&#8221;&lt;/a&gt;&gt;Brett Favre Jerseys, &lt;a href="http://www.favre-jersey.com&#8221;" rel="nofollow"&gt;http://www.favre-jersey.com&#8221;&lt;/a&gt;&gt;Favre Jerseys, Brett Favre Jerseys 60% Discount With Authentic Quality.
Our supply selection of &lt;a href="http://www.favre-jersey.com/brett-favre-minnesota-vikings-4-black-shadow-jersey-p-9.html&#8221;" rel="nofollow"&gt;http://www.favre-jersey.com/brett-favre-minnesota-vikings-4-black-shadow-jersey-p-9.html&#8221;&lt;/a&gt;&gt;brett favre vikings jersey and cheap prices on jerseys shop. Brett Favre cheap jersey like &lt;a href="http://www.favre-jersey.com/brett-favre-4-authentic-minnesota-vikings-purple-jersey-p-23.html&#8221;" rel="nofollow"&gt;http://www.favre-jersey.com/brett-favre-4-authentic-minnesota-vikings-purple-jersey-p-23.html&#8221;&lt;/a&gt;&gt;Authentic brett favre jersey with replica prices, the player&amp;#8217;s number is displayed in tackle sewn on the chest, back and sleeves, along with the team name on the front. if you like &lt;a href="http://www.favre-jersey.com/brett-favre-4-minnesota-vikings-purple-jersey-p-8.html&#8221;" rel="nofollow"&gt;http://www.favre-jersey.com/brett-favre-4-minnesota-vikings-purple-jersey-p-8.html&#8221;&lt;/a&gt;&gt;Brett Favre Purple Jersey, please buy it.&lt;/p&gt;</description>
      <pubDate>Mon, 27 Sep 2010 07:14:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:78f88935-5460-4f81-a2da-9952728fa845</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-29184</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by JetsShop</title>
      <description>&lt;p&gt;Thanks for posting this. 
&lt;a href="http://www.nfljetsshop.com/jets-jerseys" rel="nofollow"&gt;Jets Jerseys&lt;/a&gt; Very nice recap of some of the key points in my talk. I hope you and your readers find it useful! Thanks again
&lt;a href="http://www.nfljetsshop.com/jets-jerseys" rel="nofollow"&gt;http://www.nfljetsshop.com/jets-jerseys&lt;/a&gt; Jets Jerseys&lt;/p&gt;</description>
      <pubDate>Thu, 26 Aug 2010 22:27:53 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:08e73ed7-9f67-437c-a60e-9a75a5b346ec</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-22351</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by Dallas Cowboys shop</title>
      <description>&lt;p&gt;Thanks for posting this. &lt;a href="http://www.nflcowboysjerseys.com/marion-barber-jerseys-c-1_18.html" rel="nofollow"&gt;Marion Barber Jerseys&lt;/a&gt; Very nice recap of some of the key points in my talk. I hope you and your readers find it useful! Thanks again&lt;/p&gt;</description>
      <pubDate>Fri, 23 Jul 2010 21:32:21 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:a659fb61-747a-4d74-85cc-6ecbed62c8d7</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-17218</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by nfl jersey supplier</title>
      <description>&lt;p&gt;would you mind updating your blog with more information?&lt;/p&gt;</description>
      <pubDate>Mon, 28 Jun 2010 04:12:02 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:947b8fad-5e4d-4d1d-afd9-ea17dc2b32b9</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-14425</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by Steelers jerseys</title>
      <description>&lt;p&gt;would you mind updating your blog with more information?&lt;/p&gt;</description>
      <pubDate>Mon, 28 Jun 2010 04:11:19 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:75ce446e-e396-499e-ae45-ddc24e4df1a2</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-14424</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by hockey jersey</title>
      <description>&lt;p&gt;would you mind updating your blog with more information?&lt;/p&gt;</description>
      <pubDate>Mon, 28 Jun 2010 04:10:27 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:f4e606e2-0113-4116-9f52-5d38f9b31a04</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-14422</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by jewellery</title>
      <description>&lt;p&gt;would you mind updating your blog with more information?&lt;/p&gt;</description>
      <pubDate>Tue, 22 Jun 2010 04:52:56 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:2f2d0f0b-61ae-4e49-9758-4c80590a6744</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-13540</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by latin shoes</title>
      <description>&lt;p&gt;would you mind updating your blog with more information?&lt;/p&gt;</description>
      <pubDate>Tue, 22 Jun 2010 04:52:29 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:50d4b980-a221-49aa-be43-59e9f54349b0</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-13535</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by latin shoes</title>
      <description>&lt;p&gt;Most problems happens before testing, nice post anyway!&lt;/p&gt;</description>
      <pubDate>Tue, 22 Jun 2010 04:51:51 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:43be1527-1a87-4b7c-89bf-a79e466b86a9</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-13529</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by L.</title>
      <description>&lt;p&gt;This image of meat and cruft is interesting. When we remove suplication, it is just normal that the share of cruft goes up with regards to meat. You&amp;#8217;re taking two identical parts of meat  and make it one, therefore removing meat.&lt;/p&gt;


	&lt;p&gt;(I will not be talking about removing structural duplication, in which case I think that the meat/cruft ratio does not change much)&lt;/p&gt;


	&lt;p&gt;The fact that cruft (i.e. structure) is growing makes me wonder why cruft is so important in languages. Maybe because we have no other way to create structure in a flat file.&lt;/p&gt;


	&lt;p&gt;Would there not be ways to create structure in, e.g., a database instead of a flat file? Would database-managed code be a good thing? The hard part would be for a human to read the code if it is structured in a DB.&lt;/p&gt;</description>
      <pubDate>Wed, 15 Jul 2009 03:52:05 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:1f2c0985-7015-47d2-9bab-11fdc33799e3</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-3739</link>
    </item>
    <item>
      <title>"The Bloat at the Edge of Duplication Removal (The Orange Model)" by ajuc</title>
      <description>&lt;p&gt;I wold prefer such refactoring:&lt;/p&gt;


	&lt;p&gt;private void adjustPaths() {
  Path[] paths = {pathNew,pathOld};
  for (Path p : paths ) {
     p = p.removeFirstSegments(1).removeFileExtension()
                  .addFileExtension(&amp;#8220;class&amp;#8221;);
  }
}&lt;/p&gt;


	&lt;p&gt;I factors out structure from data.&lt;/p&gt;</description>
      <pubDate>Thu, 05 Mar 2009 01:07:57 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:49a745a4-b7dc-47cc-976d-d909ccf1a061</guid>
      <link>http://blog.objectmentor.com/articles/2009/02/17/the-bloat-at-the-edge-of-duplication-removal-the-orange-model#comment-2879</link>
    </item>
  </channel>
</rss>

