Re: Perl Tools For Refactoring.

Richard <[email protected]> Wed, 25 Aug 2010 15:40:16 -0600
Newsgroups gmane.comp.programming.refactoring
Organization multi-cellular, biological
Message-ID <[email protected]>
In article <[email protected]>,
    Adam Sroka <[email protected]>  writes:

> The EPIC plugin for Eclipse has some support.

Interesting!

I tried it out briefly.  It has Extract Method.  Its reasonable,
although it could still use some improvement.  For instance:

sub foo
{
	print "This is a test";
	print "This is another test.";
}

foo;

when Extract Method was applied to the two print lines, I got:

sub foo
{
	my () = test ();
	my () = anotherTest ();
}
sub anotherTest
{
	print "This is another test.";
	return ();
}

sub test
{
	print "This is a test";
	return ();
}

foo;

This produces non-functional perl code:

Can't declare stub in "my" at /tmp/foo.pl line 3, near ") ="
Execution of /tmp/foo.pl aborted due to compilation errors.

It clearly has some more work that's needed on it, but its better
than nothing.  I haven't tried any more complicated experiments where
it is supposed to infer return values and needed parameters to the
sub.  You may find this refactoring suite a useful guide in giving
EPIC's Extract Method a run for its money:

<http://legalizeadulthood.wordpress.com/2010/02/02/c-refactoring-tools-test-suite-available/>

-- 
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
 <http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>

      Legalize Adulthood! <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/