Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Refactoring copy-pasted code

by talexb (Chancellor)
on May 05, 2009 at 13:40 UTC ( #761934=note: print w/replies, xml ) Need Help??

in reply to Refactoring copy-pasted code

I'm very happy using gvimdiff between two files to get visual feedback on what parts of the file are identical. And if you find that a bunch of the scripts are identical from lines 200-400, say, it should be possible to centralize those routines in a module.

Writing tests for this kind of script can be a challenge, but setting up some test data files with as many possible corner cases should go a long way to solving that.

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2023-06-05 19:02 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (25 votes). Check out past polls.