Re: Fwd: Compiler Guided Refactoring.

Richard <[email protected]> Mon, 08 Jul 2013 17:37:56 -0600
Newsgroups gmane.comp.programming.refactoring
Organization multi-cellular, biological
Message-ID <[email protected]>
In article <CAFD1m3Hc1UOVwE+K-LOsBAN8KwkDqKYm97wNAeME1ahDGe9Rew@mail.gmail.com>,
    John Carter <[email protected]> writes:

> > The key aspect to the Extract Method with no arguments and void return
> > value (i.e. void-void extraction) is that it minimizes the risk of
> > introducing side-effects.
> 
> 
> That is what appeals to me most about it....
> 
> However, it is steps a largish notch away from the idea... ie. Tweaking
> the Declarations to Tighten the constraints enforced by the compiler.
> 
> ie. Your void-void is low risk, provided the person doing the refactoring
> doesn't,,,
> * accidentally reorder something,
> * drop a step,
> * or extract copypasta into a single method that isn't copypasta but
> copypasta and tiny easily missed tweak.

Basically what is being advocated is doing Compose Method on long
methods (functions).

Visual Assist X can do Extract Method / Extract Function and it's
pretty decent at doing it.  It's not perfect, but I use it to apply
Compose Method to long methods all the time and it works well.

If you don't have an automated Extract Method/Function, then I
wouldn't let people loose on the code with this refactoring for all
the reasons you mention.  It's too easy to screw something up that
could hide in there for a long time before it's found.
-- 
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
     The Computer Graphics Museum <http://computergraphicsmuseum.org>
         The Terminals Wiki <http://terminals.classiccmp.org>
  Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/refactoring/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/refactoring/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/