On Tue, 27 Apr 2010, Shlomi Fish wrote:

Wouldn't it mean that perl will call the _build_paragraph_name of the sub-
class upon every instantiation of an object? I could be prematurely micro-
optimising in thinking that it matters, though.

Yes, you are prematurely optimizing.

As an aside, naming an attribute with a name starting with "get" is an
abomination. If you want PBP style accessors, use MooseX::FollowPBP.
Attribute names should be nouns, not verbs.

Well, first of all, I used _get_ here in my code as a clarification because I
used it in the sub-class-mutated-constant-method previously. I realise it's
not wise to use _get_something() for attributes/properties/fields/object-
members/etc. (like has '_get_something'). Otherwise you can have code like
'$self->_get_something("New Value");'.

That put aside, I sometimes prefix methods returning calculations (not object
properties) with "get_" or "calc_". Whether *that* is a good idea, is much
more of a colour of the bike shed argument, and it probably doesn't matter too
much.

Right, _methods_ should be verbs, and attributes (declared with "has") should be nouns.


-dave

/*============================================================
http://VegGuide.org               http://blog.urth.org
Your guide to all that's veg      House Absolute(ly Pointless)
============================================================*/

Reply via email to