Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Thoughts on using subroutines to clean up code?

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?

  • Comment on Re: Thoughts on using subroutines to clean up code?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-19 04:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found