Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: A question about the best way to use subroutines

by larsen (Parson)
on Mar 25, 2001 at 15:26 UTC ( #67009=note: print w/replies, xml ) Need Help??


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

I think subroutines are supposed to be not only a shortcut when a piece of code is used a lot of times.

First of all, they are linguistic tools to hide things. In other words, to build abstractions. I think programs are built on abstractions.

So you could use subroutines even if a piece of code is used only once.It will increases readability, and maybe you will easier reuse that piece of code.

  • 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://67009]
help
Chatterbox?
[mahesh557]: Mac Pasteboard working in mac sierra?
[RonW]: Hi, Aleena
[Lady_Aleena]: Hi Ron.

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2017-02-21 20:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (319 votes). Check out past polls.