jump to navigation

Perl core, documentation and Moose (aka “can of worms”) March 5, 2011

Posted by claudio in Uncategorized.
Tags: , , ,

Creator of PerlIt seems I am not alone on the subject I raised in my New Years wishes (wishes, not demands). Good.

I wished –and still do today– that Perl releases would include Moose. I also wished for a tutorial/chapter on Object Oriented programming based on Moose for Perl newcomers. For this second wish I was specifically thinking on the upcoming release of O’Reilly’s “Learning Perl“. The nice authors answered  (see comments) and stated that they foresee the inclusion of a Moose chapter, but in the more advanced title “Intermediate Perl” instead.

On perl5-porters, the mailing list where Perl 5 development occurs, there is now a related discussion triggered by David Rolsky’s work on a new Object Oriented tutorial to be included in the Perl core documentation. It is certainly a welcome update to the present tutorial, but its use of Moose as a best practice seems to be rather polemic.

Tom Christiansen made a valid argument against a new core tutorial that included Moose:

Please don’t include anything in the standard distribution that tells people they can’t use the standard distribution.
If you want to include something in the standard distribution whose entire focus is outside the standard distribution, then you should bring the thing that is outside, inside.

Of course, this is an argument to keep references to non-core CPAN libraries out of the core documentation (isn’t CPAN not our biggest selling point?). It does not take a lot of imagination to turn the argument around and use it for the promotion of a modern Object Oriented framework to core. I am aware of the serious problem caused by the dependency chain of Moose, but it’s not that bad.

By talking with a lot of people at the Perl booth at FOSDEM I was positively surprised by the level of interest in (modern) Perl. Newbies seemed really curious and old perlers that long ago moved to other languages (“Were is Perl 6?”) were enthusiastic to give Perl a second chance. The Moose examples in chromatic’s“Modern Perl” book were a very convincing illustration of what Modern Perl was.

When (re-)introducing people to 2011’s Perl I don’t want to explain boilerplate that is difficult to grasp for new programmers (or myself ). Besides, people who are new to Perl are not necessarily new to programming and they are right not to be willing to put up with the overhead of plain OO Perl. The people I have encountered in this situation (or introduced myself to Perl) welcome –without exception– Moose as innovative and stylish (yes: the holy grail of readable code). In 2011 no one, except ironically the people writing Moose itself and “legacy programmers”, should be forced to write OO boilerplate code.

The people are there, the code is there, the momentum is there. Do we dare to take the chance?

(Picture by Dunechaser)


1. brian d foy - March 6, 2011

To be fair to Tom, he’s not stating so strongly that you shouldn’t mention non-core modules in the core documentation, but that you shouldn’t have it at the exclusion of “bare” Perl. I don’t think you can say that he’s ever really thought that since some of the answers in the perlfaq specifically punted to CPAN. Tom isn’t anti-CPAN, and that’s not his argument.

claudio - March 6, 2011

Yes. I am not anti-Ttom either:). I hope this comment clarifies that.

He was just the first that touched the core of the argument (as I see it).

2. Make noise like a camel! « *n*x - March 8, 2011

[…] core, or rather move things from CPAN to core. Maybe the window is too small to get what we need (IMHO, a complete OO framework). Or it may be already closed due to the complexity and the quantity of extra work for the already […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 197 other followers

%d bloggers like this: