From: Dave Rolsky Date: Tue, 30 Dec 2008 14:54:21 +0000 (+0000) Subject: merge from trunk to moose-manual branch X-Git-Tag: 0.66~27^2~20 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b64779648b80ec89a669fd7649f745c948ec329f;p=gitmo%2FMoose.git merge from trunk to moose-manual branch --- b64779648b80ec89a669fd7649f745c948ec329f diff --cc lib/Moose/Manual/BestPractices.pod index 8211324,0000000..96b4093 mode 100644,000000..100644 --- a/lib/Moose/Manual/BestPractices.pod +++ b/lib/Moose/Manual/BestPractices.pod @@@ -1,39 -1,0 +1,43 @@@ + +=head1 RECOMMENDATIONS + +=head2 No Moose and Immutabilize + +We recommend that you end your Moose class definitions by removing the +Moose sugar and making your class immutable. + + package Person; + + use Moose; + + # extends, roles, attributes, etc. + + # methods + + no Moose; + + __PACKAGE__->meta->make_immutable; + + 1; + +=head2 Always call SUPER::BUILDARGS + +=head2 No complex subs for a default, use a builder + +builders can be inherited, show up more cleanly in profile + +=head2 use default for simple scalar, and empty refs + +=head2 use builder for everything else + ++don't use initializer ++ +=head2 use lazy_build + +keep builders private + +consider keeping clearers & predicates private + +consider keeping writers private ++ ++=head2 use MX::AH instead of auto_deref