[Melbourne-pm] Moose [was Google Wave Anyone?]

Brad Bowman list at bereft.net
Fri Oct 30 00:56:37 PDT 2009


Michael Potter wrote:
> On Thu, Oct 29, 2009 at 3:51 PM, Daniel Pittman <daniel at rimspace.net 
> <mailto:daniel at rimspace.net>> wrote:
>     Toby Wintermute <tjc at wintrmute.net <mailto:tjc at wintrmute.net>> writes:
> 
>     [...]
> 
>      > In other news; I'm liking Moose a lot, especially since the .9
>     release
>      > with all the built-in attributes and corresponding traits.. but I'm
>      > curious to know what everyone else thinks of Moose.
>      >
>      > It's evidently superior to Perl's existing OO framework, which
>     has been
>      > showing it's age and tacked-on-afterwards feel for a long time..
> 
>     Well, Moose is pretty much just syntax sugar and convention, sitting
>     over the
>     top of the traditional Perl OO design.
> 
> Err....no. Moose allows for idioms that are rarely if ever used in 
> conventional Perl OO programming. For example composition/delegation, 
> method currying, built in type definition and validation, attribute 
> traits, roles, full meta-class reflection and so much more. Once you 
> start programming in Moose you will adopt an entirely new way of 
> thinking about OO programming that leaves old-school Perl OO in the dust.

Not so much as response, as a question...

So basic OO begat God-Objects, deep & brittle inheritance,
ambiguous multiple-inheritance, over-emphasis on mutable state,
missing ->super calls, lot's of cut-and-paste boiler-plate
and many more problems.

http://en.wikipedia.org/wiki/Anti-pattern#Object-oriented_design_anti-patterns

We eventually learned about single-inheritance, interfaces, C3,
roles, Liskov substitution, MOPs, immutability, delegation,
whatever those "before" and "after" methods are called
and which features should never have even existed (eg. pseudo hashes).

The challenge:
Predict the anti-patterns that other programmers
(not *you* of course) will fall into using the new tools from
the Moose ecosystem.

To get things rolling, I suggest that just as everyone has
written their own DBI ORM, everyone will write their own meta-object
layer.  It will be fun, an informative exercise and mistaken.

TIMTOWTFIU

Brad

PS. I'm looking forward to Moose becoming the defacto Perl 5
OO model.  It seems to have the momentum, and it got the momentum
not by being anointed, but by being good.  It has smart folks
behind it.  It plays well with other modules and OO schemes.
It has stolen many good ideas from elsewhere.
There's issues with speed and memory relative to old-school
Perl 5 OO, but they're being worked on and it's seems abstract
enough to be optimizable in future.



More information about the Melbourne-pm mailing list