Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: efficient use of subroutines

by BillKSmith (Monsignor)
on Feb 05, 2015 at 23:54 UTC ( [id://1115717]=note: print w/replies, xml ) Need Help??


in reply to efficient use of subroutines

Several people have said that a subroutine should "do one thing." In that spirit, there is a simple test for whether or not a block of code should be a subroutine. If the code can be completely described in one sentence with no 'and', 'or' or 'but', it probably should be a subroutine.

Note: This is not an original idea. It is paraphrased from Yordon and Constantine's 1979 book "Structured Design"

UPDATE: Corrected Reference.

Bill

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2024-04-24 12:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found