Loading ...
Sorry, an error occurred while loading the content.
 

Re: [XP] Only refactor methods out to remove duplication?

Expand Messages
  • Steve Howell
    ... Imagine all the rocks sitting on a big scale. You have two hammers. Every time you strike the rocks with the deduplication hammer, the arrow on the scale
    Message 1 of 55 , Nov 27, 2003
      mfeathers@... wrote:

      >Funny you should mention that. I was thinking last night about why method size may follow the power-law in well-factored code and I was guessing that it has something to do with repeated division. I was thinking that if you took a group of rocks distributed normally in size and started to smack them with a hammer over time you'd get a power law distribution. Each time you break up a rock you are replacing it with more than one smaller one. If you don't favor only the big ones and smack them all over time, including the results of earlier splits, it seems like a recipe for the distribution. Seems like it could map well to bias towards breaking up methods. The hammer strikes again.
      >
      >
      >
      Imagine all the rocks sitting on a big scale.

      You have two hammers.

      Every time you strike the rocks with the deduplication hammer, the arrow
      on the scale goes down.

      Every time you strike the rocks with the encapsulation hammer, the arrow
      on the scale goes up. (Now, admittedly, some of the smaller pebbles
      you'll never have to look at, so we shouldn't count them as part of the
      weight, but they're still on the scale.)

      Which hammer do you sharpen first?

      (Sorry, mixing metaphors there.)

      ;)
    • Steve Howell
      ... Imagine all the rocks sitting on a big scale. You have two hammers. Every time you strike the rocks with the deduplication hammer, the arrow on the scale
      Message 55 of 55 , Nov 27, 2003
        mfeathers@... wrote:

        >Funny you should mention that. I was thinking last night about why method size may follow the power-law in well-factored code and I was guessing that it has something to do with repeated division. I was thinking that if you took a group of rocks distributed normally in size and started to smack them with a hammer over time you'd get a power law distribution. Each time you break up a rock you are replacing it with more than one smaller one. If you don't favor only the big ones and smack them all over time, including the results of earlier splits, it seems like a recipe for the distribution. Seems like it could map well to bias towards breaking up methods. The hammer strikes again.
        >
        >
        >
        Imagine all the rocks sitting on a big scale.

        You have two hammers.

        Every time you strike the rocks with the deduplication hammer, the arrow
        on the scale goes down.

        Every time you strike the rocks with the encapsulation hammer, the arrow
        on the scale goes up. (Now, admittedly, some of the smaller pebbles
        you'll never have to look at, so we shouldn't count them as part of the
        weight, but they're still on the scale.)

        Which hammer do you sharpen first?

        (Sorry, mixing metaphors there.)

        ;)
      Your message has been successfully submitted and would be delivered to recipients shortly.