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

(tye)Re: Refactoring

by tye (Cardinal)
on Apr 09, 2001 at 19:35 UTC ( #71024=note: print w/ replies, xml ) Need Help??


in reply to Refactoring

I was wondering if it was just me... These types of changes aren't at all what I think of when I hear the term "refactoring". At the least, these would be at the very bottom of the scale.

To me, refactoring a program is like refactoring in math. In math, refactoring could be used to change (x^2-2x-3)(x^2+2x-3)
to (x^2-1)(x^2-9)
So I tend to think of refactoring as redesigning the boundary between the pieces that make up your program, often allowing code that is repeated to be removed.

I have a hard time coming up with good specific examples as refactoring is usually rather complex in my book. Some rather lame examples might be taking a handful of global variables and putting them into an object or changing a subroutine that takes a ton of arguments into one that takes a hash of options where most of them are optional with good defaults so most calls no longer need to specify them.

I guess the examples given so far just seem too trivial. (:

        - tye (but my friends call me "Tye")


Comment on (tye)Re: Refactoring
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2015-07-07 15:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (91 votes), past polls