<div dir="ltr"><br><div class="gmail_quote"><div class="HOEnZb"><div class="h5">
Back in 2005 Damien wrote his now-famous Perl Best Practices, and<br>
recommended separate get_ and set_ methods for accessors.<br>
<br>
I just now noticed a post by Dave Rolsky (himself no lightweight)<br>
<a href="http://blog.urth.org/2011/03/23/reviewing-perl-best-practices-chapter-15-objects/where" target="_blank">http://blog.urth.org/2011/03/23/reviewing-perl-best-practices-chapter-15-objects/where</a><br>
he opines:<br>
<br><div style="margin-left:40px">
---<br>Damian wants you to write get_name() and set_name(). I don’t think this<br>
ever took off. My personal preference is name() and set_name(), though<br>
that’s just as unpopular.<br>
<br>
I think the real recommendation should be to use read-only attributes as<br>
much as possible. Mutability adds complexity to your code. Avoid it<br>
whenever possible.<br>
<br>
In that context, I’d avoid the get_name() style. Very little Perl code I’ve<br>
seen uses that naming scheme. The naming of writers matters less if they’re<br>
rare, but readers will be common, and you should just use the style that<br>
everyone else uses.<br>---<br></div>
<br>
I've also rarely seen that naming scheme (and don't use it myself), but<br>
haven't done an exhaustive survey.<br>
<br>
Does anyone else have a sense on how widespread the take-up of that<br>
particular Best Practice has been?<br>
</div></div></div><br></div>