in reply to Getter and Setter Function Names

When you can do both get and set on a property, then I personally like to have direct access to the variable. For me this is the clearest way:
$obj->{property} = 'something'; # for setting $somevar = $obj->{property}; # to get the value
I just don't see the any advantage in using a specialized functions for it. Getting and setting values of variables is something so basic for programming that I find it the most intuitive way for the task.

Replies are listed 'Best First'.
Re: Re: Getter and Setter Function Names
by Biker (Priest) on Apr 10, 2003 at 15:39 UTC

    Until the maintainer of the class decides to add something to the "getter" or the "setter" method. Like data checking, or persistance or some such. You'll be left out.


    Everything went worng, just as foreseen.

      Of course it is always a matter of tradeoff. You can't program against all possible future changes. You just need to forsee the most probable.