5 ms·
He's referring to Moose, which is an insanely good object system, which wasn't prevalent at all 18 months ago but is nearly de rigueur in all but a handful of c
by KaeseEs 16y ago
He's referring to Moose, which is an insanely good object system, which wasn't prevalent at all 18 months ago but is nearly de rigueur in all but a handful of cases today. It's a mashup of CLOS, Perl 6, Smalltalk and a few other things that remains consistent, Perlish and intuitive. It's also crazy extensible - just look at the MooseX namespace on CPAN to see what I mean.
- prodigal_erik 16y agoHow much of CPAN has been migrated to Moose, as opposed to directly calling "bless" as the docs[1] advocate even now? As I understand it, the story on interop between the two styles is "don't go there". [1]http://perldoc.perl.org/perlobj.html http://perldoc.perl.org/perlobj.html
- berntb 16y agoThe perlobj perldoc is about the old style OO -- and discusses the old style OO... :-) It doesn't discuss any CPAN modules at all (there are quite a lot about OO). Are you trolling? What problems do you mean with Moose and the blessed OO?
- prodigal_erik 16y agoNot at all. I learned Perl from the manpages, and I'm mystified how noobs are to discover and convince themselves that "man perlobj" is now bad advice yet remains official. As for bless/Moose interop, I read somewhere there were big problems mixing the two but don't remember the specifics (I mostly dropped Perl a long time ago over its dogged attempts to guess what I probably wanted when I made a mistake). Others in this thread now say that's not true if it ever was, which is good news for users of pre-Moose CPAN modules.
- berntb 16y ago>>I learned Perl from the manpages Well, that was impressive. Stupid, but impressive... :-) >>discover and convince themselves that "man perlobj" is now bad advice yet remains official. AGAIN: Those man pages doesn't discuss CPAN modules. But afaik, they recommend books and the web...
- prodigal_erik 16y agoMeh, I don't care for being spoonfed. I also read RFCs. I'm actually embarrassed to have paid for Real World Haskell, because if I were as smart as I want to be I wouldn't need it. In this case, neither perlobj, perlboot, nor perlbot mention any CPAN modules at all, and perltoot cites a couple but Moose isn't among them.
- chromatic 16y agoI'm mystified how noobs are to discover and convince themselves that "man perlobj" is now bad advice yet remains official. Me too, which is one reason I'd like to remove it, or at least fix it.
- berntb 16y agoThe Perl 5 world seems to change quite a lot every few years. If people have an old install, perldoc might be out of date. Wouldn't it be better to just add an URL at the top of the page to a page at perl.org and put the best practices for CPAN there?
- perigrin 16y agoThe question is should the documentation shipped with perl document the features available with that distribution, or should it document the features available in the wider Perl culture? For example, Moose has always made an effort to cooperate with the native Perl object system. The documentation in the perldoc's for object oriented programming isn't wrong. The skills you learn from perltoot and companions will transfer to Moose, you'll know how the underlying implementation works. Is this the right way to learn Perl's Object Oriented programming? That is an argument the Perl community itself is having[1]. As that argument is resolved the documentation is updated. If you think about this in startup terms. Moose as a project is 4 years old. Would you invest in a startup that had an exit strategy that was targeted for than than 5 years? Moose has just recently (in the last year or two) reached a dominant market position when compared to the existing competition (Class::MethodMaker, Class::STD, etc) but still is adopted by only 5% of the total market (that is we have ~1K direct downstream dependencies out of about 20K distribution on CPAN). It would be premature to expect the industry to recognize let alone promote Moose as the de-facto standard. However it would be an excellent bet that sometime in the next few years that will happen. Of the "Modern Perl" distributions out there Moose is one of the most consolidated in it's scope. Things like Catalyst have been gaining new competition (Dancer, Mojolicious) in their respective markets. It's interesting to watch things that appear to my untrained eye like market forces play out across the adoption of various CPAN modules. To circle back around, perl documentation needs to strike a careful balance between what they can guarantee exists (bless $ref, __PACKAGE__) and what the community accepts as best practice (use Moose;). The documentation needs to intentionally be less dynamic than the fashions of the community. It must be conservative enough to provide continuity so that someone who happens to be on a perl-5.8.8 box (released 3 months before Moose, and still the standard on RHEL if I recall) doesn't learn a whole different set of "best practice" modules than someone on a 5.10.1 box. It does however need to be updated as things like Moose take over the mind share and prove themselves out. When only 1 in 20 modules you run into will likely involve Moose, you'll still need to understand the native solutions. When that ratio changes, the balance will need to change too. [1]: http://stackoverflow.com/questions/980751/should-i-learn-perl-5-oo-or-moose-first/ http://stackoverflow.com/questions/980751/should-i-learn-per...
- phaylon 16y agoI use Moose combined with non Moose OO libraries all the time and only run into troubles when they are doing some really funky stuff on the inside (The Glib wrappers were hard to tackle, but they have to be funky, since they're a C OO to Perl interface). Most of this is thanks to MooseX-NonMoose which takes care of most common things.
- chromatic 16y ago> As I understand it, the story on interop between the two styles is "don't go there". Interop between Moose and legacy Perl 5 OO works just fine.
- jlees 16y agoGood to know. Should I ever feel masochistic enough to look back at Perl, I'll undoubtedly check it out. And this reply alone is proof Perl isn't dead.