[raleigh.rb] The cost/benefit of refactoring
nathaniel at talbott.ws
Thu Dec 11 15:21:59 EST 2008
On Thu, Dec 11, 2008 at 2:49 PM, Jonathon Brenner <jon.list+rb at gmail.com> wrote:
> The original code is commented out. The new refactored code passes lambdas
> to the "manager" method. My issue basically boils down to redundancy versus
> - The original code is simpler for both me and ruby (it flogs lower due to
> the lack of the lambda calls).
> - The new code only only calls SNMP::Manager#open in one place, which makes
> it easier to change the call later.
I put it on gist and did an edit that should take your flog score down:
Basically, you can use the block directly without using a lambda.
In general I like your refactoring, since it cuts down on the duplication.
More information about the raleigh-rb-members