[Catalyst-dev] Moose Port: Class::C3 vs Moose Method Modifiers
Marcus Ramberg
marcus at nordaaker.com
Sun May 25 09:44:30 BST 2008
>
> --- On Tue, 5/20/08, Guillermo Roditi <groditi at gmail.com> wrote:
>> At one point, we completely removed any usage of NEXT and
>> replaced it
>> with method modifiers but then someone said something
>> (don't know who
>> or what) and so I moved back to Class::C3. mst has voiced
>> his complaints about this and made some reference to
>> Class::C3::import
>> being evil but I do not understand what that means and the
>> test suite seems to work so I take it that it's not really an
>> issue. There was
>> also concerns over compatibility with 5.10 but I do not
>> have a 5.10 box available so someone who uses 5.10 will need to test
>> there and let us know if something breaks.
>>
> Personally I prefer Moose style modifiers since for me it makes
> everything much more clear. When you see something like:
>
> around 'method' ->sub {...}
>
> You know around away what this method is doing. You don't have to
> hunt around in the method body for a next:method call.
>
> Additionally, method modifiers offer you more fine grained control.
> If you are just doing something before a method, but don't need to
> mess with the arguments or return value, you can use "before".
> That's not even counting the ability to use augment and inner() for
> the cases where those make sense.
>
> Overall it's going to give us more flexibility and have the bonus of
> introducing the syntax to people that may not have seen it before.
> The only downside I can see is the very small learning curve and the
> possibility that some of the pod coverage tools might give false
> errors. Also, most of the Perl syntax highlighting rules haven't
> caught up with some of the new Moose syntax, so I guess some people
> might complain about that.
I would like us to use method modifiers as well. This is one of the
reasons to switch to Moose, imo.
Marcus
More information about the Catalyst-dev
mailing list