Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: problems passing variables between subroutine

by GrandFather (Cardinal)
on Sep 05, 2012 at 23:25 UTC ( #991970=note: print w/ replies, xml ) Need Help??


in reply to Re^2: problems passing variables between subroutine
in thread problems passing variables between subroutines

Avoid "future proofing" code. Almost always we guess wrong about how things are going to go in the future. Leaving decisions until they need to be made generally works better - you have better information to base the decision on. If you guess and decide early it can be much harder to change your mind. You can easily end up with either a lot of work throwing away the code that was never used and rewriting it differently, or accept a sub-optimum solution that becomes hard to understand and maintain.

With that in mind:

  1. Only pass parameters that are used
  2. Only calculate and return results that are used
  3. Don't use global variables
True laziness is hard work


Comment on Re^3: problems passing variables between subroutine

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2014-12-28 15:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (182 votes), past polls