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.
  • First, as a minor nit, you can declare multiple attributes at once, which is a little less repetitive.

    has [qw( this that )] => ( is  => 'ro', isa =>'Str' );

    As for "with", do you understand in what cases you need to put "with" after you declare your attributes? Even if you do, does everyone on your team (now and in the future)?

    The thing I've come to appreciate about Moose is that it expects you to know what you're doing. E.g. you compose roles after attributes when roles require those attri

    • The idea of encapsulation is the very reason that we have most APIs.

      The idea that you don't NEED to know how something is implemented is always going to be better, as long as that lack of knowledge does not compromise the integrity of the systems or lead to perverted incentives.

      What good is a car that requires an intimate understanding of the underlying engine and brakes and gearbox. It might be handy if you are an enthusiast of a racing car driver or pushing the limits in some other dimension.

      What good is

      • It sounds like you're talking about encapsulation from the standpoint of users and APIs, which is different. Or, rather, it's the same but applied to Moose itself rather than what someone is designing using Moose.

        Unlike users, the designers of a system must understand the dynamics of the design. That can't be safely abstracted away. Role composition is a design activity that involves satisfying certain constraints and avoiding certain conflicts in order to get the desired behaviors.

        My point was that the Moose API is very transparent about these design decisions and the temporal order in which they are carried out. The Moose API could have provided visual sugar which obscured the temporal order, but it did not. I think that's the right design decision for a very complex tool like Moose.

        MooseX::Atom provides an alternate approach that appears to optimizes visual clarity over design clarity. That's a valid choice if you prioritize the other way.

        -- dagolden []