[sf-perl] Fwd: Delivery Status Notification (Failure)
cpan at goess.org
Mon Sep 30 15:55:15 PDT 2013
Back in 2005 Damien wrote his now-famous Perl Best Practices, and
recommended separate get_ and set_ methods for accessors.
I just now noticed a post by Dave Rolsky (himself no lightweight)
Damian wants you to write get_name() and set_name(). I don’t think this
ever took off. My personal preference is name() and set_name(), though
that’s just as unpopular.
I think the real recommendation should be to use read-only attributes as
much as possible. Mutability adds complexity to your code. Avoid it
In that context, I’d avoid the get_name() style. Very little Perl code I’ve
seen uses that naming scheme. The naming of writers matters less if they’re
rare, but readers will be common, and you should just use the style that
everyone else uses.
I've also rarely seen that naming scheme (and don't use it myself), but
haven't done an exhaustive survey.
Does anyone else have a sense on how widespread the take-up of that
particular Best Practice has been?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SanFrancisco-pm