Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Refactoring

by Wally Hartshorn (Friar)
on Feb 28, 2003 at 15:41 UTC ( #239456=note: print w/ replies, xml ) Need Help??


in reply to Bad Practice

I'm just now getting into it, but one of the practices of Extreme Programming (dorky name, but good ideas) is constant refactoring of code. (Must use more buzzwords!) Basically, when you see a bit of code that could be made clearer or that, if changed, would make it easier to add the new functionality on which you are working, you do so.

However, you should only do the refactoring if you have unit test cases that you can run to verify that your changes didn't break anything. In addition, you should do the refactoring of the old code separately from adding the new functionality, so that you can know whether any problems shown by the unit test cases are the result of the refactoring or are the result of the new functionality.

In short, improving code is a good thing, so long as you can verify that the improved code works as well as the old code.

Wally Hartshorn

(Plug: Visit JavaJunkies, PerlMonks for Java)


Comment on Refactoring

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://239456]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2014-10-25 01:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (139 votes), past polls