Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: User preference: To store params or not

by sundialsvc4 (Abbot)
on Jul 29, 2015 at 13:18 UTC ( [id://1136744]=note: print w/replies, xml ) Need Help??


in reply to User preference: To store params or not

And I once did something very similar to jeffa’s suggestion, defining an object which initialized a set of defaults.   A method was provided which allowed you to override those defaults using the content of the method’s own parameter-list, @_, thus defining the defaults for all subsequent calls to the extent that you didn’t want to use the “canned” ones.

This, I think, is a very important feature, because if you are obliged to repeatedly specify the same things to many calls, you will eventually fail notice that some parameter was left out, or that words two were accidentally specified in the wrong order, and so on.   ;-)   When you are reading a lot of source code, in Paris in the the Springtime, it is easy for your eye to see what it expects, not what the compiler will see.

Log In?
Username:
Password:

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

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

    No recent polls found