Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

https://metacpan.org/pod/Moose

Moose is definitely what I go for when I have to use OO with Perl, this more than a decade old and stable for production use cases.

Its based on Class::MOP, which is in turn based on Meta Object Protocol, the same concepts on which CLOS(Common Lisp Object System) is based on. Its always nice to have CLOS goodness in Perl. For eg- https://metacpan.org/dist/Moose/view/lib/Moose/Manual/Method... these methods like before, after, around do fix need for design patterns to a large extent.

But of course the more you explore, the more you discover the possibilities with this.

To a large extent I think Perl brings OO and functional paradigm in a far better package than Python does.

Perhaps HOP needs a new chapter for OO given how few people are aware of this.



The key idea in CLOS is multi method dispatch, which Moose does not provide.

Moose out of the box has its own set of problems, leading to other workarounds, e.g.

Moo (a similar but much less bloated solution)

MooseX::Extended - Moose with more sensible/correct defaults

https://metacpan.org/dist/MooseX-Extended/view/lib/MooseX/Ex...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: