Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Thoughts on using subroutines to clean up code?by salva (Canon) |
on Mar 10, 2017 at 08:06 UTC ( [id://1184148]=note: print w/replies, xml ) | Need Help?? |
IMO, the key point when deciding to convert some piece of code into a helper subroutine is considering if there is a conceptual boundary around it. Can you put a name on that? are the input arguments and the outputs evident?
Another good question you could ask yourself is: when I come back to this code in a couple of months would I be able to understand the main subroutine just looking at it, without having to inspect the helper too?
In Section
Seekers of Perl Wisdom
|
|