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

Re: Refactoring Perl 2 - Inline Method

by hossman (Prior)
on Jun 26, 2007 at 20:35 UTC ( #623485=note: print w/ replies, xml ) Need Help??


in reply to Refactoring Perl #2 - Inline Method

It's been a while since i looked at the Refactoring book, but as i recall "Inline Method" is only recommended when the method is only used in a very few number of cases (typically only within the class that defines it)

As you point out, for examples like this it might instead make sense to refactor the constant (5) to a global variable (or to a new method call to get it from configuration) ... either of which might then ultimately lead to a decision to inline the method anyway because it's now easier to read/understand then it was before.


Comment on Re: Refactoring Perl 2 - Inline Method

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2014-08-20 05:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (105 votes), past polls