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

Re: Getter and Setter Function Names

by DrManhattan (Chaplain)
on Apr 09, 2003 at 22:39 UTC ( [id://249461]=note: print w/replies, xml ) Need Help??


in reply to Getter and Setter Function Names

Assuming you're referring to object methods, I take a different stance than Ovid. I like using overloaded methods that match my variable/column names. For instance, if my object represents a database row with a "salary" column,
$object->salary() # returns the value of salary $object->salary(1234) # sets salary to 1234

In the end what really matters, though, is that you establish a standard practice and follow it. The exact nature of the practice is less important than your consistancy in adhering to it.

-Matt

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-03-29 13:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found