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

Re: [extremeperl] Re: I almost had a heart attack: you call that refactoring???

Expand Messages
  • Rob Kinyon
    ... I think that this applies more to languages like C or Java where runtime function generation isn t possible. In Perl, Javascript, and other functional-like
    Message 1 of 17 , Apr 3, 2005
    • 0 Attachment
      > There's also a rather subtle problem that exists when you have code
      > that is identical but represents different rules that may diverge in
      > the future. My caffeine-deprived brain can't think of an example right
      > now,

      I think that this applies more to languages like C or Java where
      runtime function generation isn't possible. In Perl, Javascript, and
      other functional-like languages where eval and closures exist, being
      able to abstract a function's structure means that refactoring can be
      done based on both identical rules and identical structure, but
      different rules. So, I'm giong to disagree with this here, Ovid.

      But, because you have this power, it is important to use it wisely.
      So, in languages where eval and closures exist, I would argue that you
      -definitely- have to wait until the third copy before refactoring.

      Rob
    • Adrian Howard
      ... I ll make it 7 and 4 since I m not dogmatic about either. I probably lean towards the refactor-at-first-sign-of-duplication camp. However there are
      Message 2 of 17 , Apr 7, 2005
      • 0 Attachment
        On 2 Apr 2005, at 18:46, Curtis Poe wrote:

        >
        > On Apr 2, 2005, at 9:34 AM, Tom Vilot wrote:
        >
        >>> Against: 2 (Jim, Terrence)
        >>> For: 4 (Rob, Rob, Chris, Johan)
        >>
        >> five, actually. Count me in the 'for' list.
        >
        > May as well make it six. I used to think the "never duplicate" rule
        > was good and sometimes the second time I do something I refactor on the
        > spot, but I've been bitten too many times by a quick refactoring only
        > to realize I didn't have a full grasp of what needed to be refactored.
        > 3 or more times is a good rule of thumb.

        I'll make it 7 and 4 since I'm not dogmatic about either. I probably
        lean towards the refactor-at-first-sign-of-duplication camp. However
        there are certainly plenty of times where my small brain has no idea
        the direction the code is going so I let the code tell me what it wants
        to do by waiting for a few more examples.

        Adrian
      • Adrian Howard
        On 7 Apr 2005, at 08:36, Adrian Howard wrote: [snip] ... [snip] And the quote of the day site gave me this today. Never express yourself more clearly than you
        Message 3 of 17 , Apr 7, 2005
        • 0 Attachment
          On 7 Apr 2005, at 08:36, Adrian Howard wrote:
          [snip]
          > However
          > there are certainly plenty of times where my small brain has no idea
          > the direction the code is going so I let the code tell me what it wants
          > to do by waiting for a few more examples.
          [snip]

          And the quote of the day site gave me this today.

          Never express yourself more clearly than you are able to think.
          - Niels Bohr (1885 - 1962)

          :-)

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