Browse Groups

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

(55)
• NextPrevious
• ... 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
View Source
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.)

;)
• ... 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
View Source
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.
• Changes have not been saved
Press OK to abandon changes or Cancel to continue editing
• Your browser is not supported
Kindly note that Groups does not support 7.0 or earlier versions of Internet Explorer. We recommend upgrading to the latest Internet Explorer, Google Chrome, or Firefox. If you are using IE 9 or later, make sure you turn off Compatibility View.