Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: A question about the best way to use subroutines

by MeowChow (Vicar)
on Mar 25, 2001 at 12:30 UTC ( #66990=note: print w/ replies, xml ) Need Help??


in reply to A question about the best way to use subroutines

Here's some fairly common heuristics for you. Factor code out into subroutines when:

  • You see sections of code that look nearly identical.
  • You realize that some specific task your code performs is just a particular case of a more general task.
  • You can imagine a scenario in which your code would be copied-and-pasted somewhere else.
  • You can think of your code as performing a "black-box" transaction.
   MeowChow                                   
               s aamecha.s a..a\u$&owag.print


Comment on Re: A question about the best way to use subroutines

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (11)
As of 2015-07-02 11:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (34 votes), past polls