Tuesday, September 1, 2009

Re: Moose Or No Moose

Moose love controversy, in fact you could say that they are natures attention whores (second only to those nasty hairless apes that seem to be everywhere!). If they aren't endorsing controversial politicians, having kinky sex or crashing expensive cars then you can likely find them partying all night at the hottest clubs. And of course all this attention leads not only to a lot of imitation but even some haters.

The same can be said of the Moose perl module (well, the controversy part anyway, modules can't have sex or drive cars, DUH!). The latest controversy is surrounding a blog post by David Cross in which he tells the story of a RT "bug" report he got after porting his Array::Compare module to Moose.

The bug report was submitted by Adam Kennedy who has a well known fetish for all things tiny. While I do not share Adam's love for CPU/Memory conservation, I do respect his efforts in trying to keep some of the critical tools of our beloved Perl infrastructure slim and easily installable. And in fact, in this case I do have to agree with Adam, before you port an existing module to Moose it helps to look downstream a little.

The benefits Moose provides for a module as straightforward as Array::Compare are actually pretty minimal, it is only using a few simple attributes and not much more. But Moose does come with a well known startup cost (don't let the haters tell you we are slow, once we get up and running things are plenty fast enough and getting faster), which Array::Compare was passing onto all its dependencies. One of those (now former) dependencies was Test::Warn which itself has 101 modules that in turn depend on it in their test suites. The result is that this simple change with minimal overall benefits has imposed a cost on a sizable chunk of the CPAN.

Now you could argue that Padre - The Perl IDE (the project that initially sparked all this) is an IDE and like other IDEs (Eclipse, Visual Studio, etc) it should take forever to start up so as to allow developers a leisurely morning coffee break. Or you could argue that it is Dave's module and he can do whatever he wants with it, downstream dependencies be damned. You could even say that Moose will eventually be fast enough so people should stop whining and just be patient. But in the end, we (CPAN) are a large and heavily interdependent community and I believe we should be respectful to our neighbors as much as possible.

Anyway, Nuff Said,... Peace out to all mah homeys attending YAPC::Asia, wish I could have come this year.

2 comments:

  1. I'll pour out a forty of shochu for you brother.

    ReplyDelete
  2. I should point out that Test::Warn had moved from using Array::Compare long before I introduced my change. The only problem was that evn though they were not longer using the module, it was still listed as a dependency in META.yaml.

    But that's all fixed now.

    ReplyDelete