Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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")

In reply to (tye)Re: Refactoring by tye
in thread Refactoring by stephen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-03-28 22:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found