Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • This created a bit of a frenzy. I used some harsh words and wound up writing a lot more in replies than in the original comments.

    So, let me back up a bit here and qualify that. I know this doesn't undo the damage, but at least I can go on record.

    Moose has a cost. It might be low or high -- I'm not qualified to say and it's beside the point. If the value of your module is lower than this cost, please reconsider using Moose.

    Moose adds some startup time, which is of concern to CGI apps and command line apps. It does not however actually slow down running code, generally speaking. Accessors are highly optimized. When I talk about cost, I mean the whole complex set of bugs you might stumble over, the chance that it fails to install as a dep of something else, rough edges like Moose specific stuff in call stack traces, and whatever else. This is the "cost" I'm referring to. Everything has a cost.

    If you're a Perl programmer you're a different creature from a CPAN module author (and the porters are different creatures yet). If you're a Perl programmer writing an app, use Moose! Unless of course you want to use something else instead. If you're a CPAN module author, then other factors come into play. Your module might be the dependency of another dependency and no one cares about your module at all other than they want it to install without problems, quickly, and without grief. In that case, whether I personally think you should use Moose or not is "it depends". An application developer doesn't have to worry about the cost. You do. Or at least I'd like you to, please =)

    As far as Moose being "as bad as Switch", that was a bit harsh. I should have compared using Moose to Inline::C versus XS. I personally like to see modules that are light and themselves don't rely on a lot of magic, but I also realize there's an aesthetic going right now towards code re-use. There never was an aesthetic towards the use of source filters. Having deps is far more defensible than using a source filter. I'd rather any random module didn't import Moose but if you're writing a module and you actually benefit from using it, go for it. If it makes your code longer, I'm going to taunt you.

    I'm back peddling here and I don't want to lose sight of that, but the lack of argument against something is not an argument for it. That's the fallacy vacuum cleaner salesmen use -- if you can't argue good reasons for not buying it, then of course, you have to buy it! Talking to people about Moose, I keep hearing things along the lines of "people should use it, because it only has problems in scenario X and Y, and that doesn't apply to them!". Again, that's not an argument for Moose, just one argument not against it.

    It would be more respectful to people to hear pros and cons. It has pros. It's prototyping a lot of ideas coming up in Perl 6 and giving you access to them now. It gives you access to an ecology of OO helper thingies. Etc, etc.

    I know the developers have heard over and over again about the startup time and size of the beast (in terms of code and modules used). This has probably overly polarized the matter. Just because this is the most common criticism doesn't mean that Moose will go on to rule the world if those are fixed. Speaking from experience, the people who complain about something are the ones who wouldn't buy it anyway even if the flaws were fixed. In other words, it's not the flaws keeping them from buying, but their disinterest in buying that leads them to find flaws. So, Moose team, please don't work yourselves too hard optimizing things for people who may or may not convert into customers anyway and don't pay too much mind to the criticism. Everyone, myself included, is a master of the obvious. 99% of what's said by 99% of people is just chatter designed to establish a connection based on shared perception, not any sort of real insight.

    So, how about the weather, eh?


    • By the way, I wrote the original article after fighting with Moose as a dep for a 30 line module that really had no business using it, and was shorter with it removed. Moose became my punching bag for all of the failed deps that had pissed me off recently. I'm going to, in the future, argue for a minimal aesthetic in Perl without using a punching bag, but rather just on merits alone.