should each attribute have its own accessor method or is it ok (or better) to have one accessor for all the attributes.
That is should my code look like:
my $name = $object->get_name;
or
my $name = $object->get('name');
Or something else completely.
Thanks for the input.
(I used <pre> on purpose.)
I did look around. Why get() and set() accessor methods are evil had interesting thoughts, but I think it might be helpful to look at it again.
In reply to Accessor methods again. by gam3
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |