Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: OO automatic accessor generation

by Jenda (Abbot)
on Nov 11, 2009 at 15:34 UTC ( #806519=note: print w/replies, xml ) Need Help??

in reply to OO automatic accessor generation

Moose. And do not let the "postmodern" blurb scare you away.

There is also Mouse and Class::Accessor.

Enoch was right!
Enjoy the last years of Rome.

Replies are listed 'Best First'.
Re^2: OO automatic accessor generation
by WizardOfUz (Friar) on Nov 11, 2009 at 16:05 UTC

    I really don't think that referring beginners (who want to learn OO programming in Perl) to Moose is such a good idea. In doing so, they will learn nothing (well, almost nothing) because Moose quite effectively hides Perl's OO concepts/mechanisms from them.

      I'll disagree. There's two levels of "learning" here. If you want to get stuff done, and you need to use objects and Perl, Moose is the perfect solution. If you want to learn the guts of Perl, and you know that Perl has some cool low-level technology for method dispatch, then yes, Moose is for later, not for now.

      -- Randal L. Schwartz, Perl hacker

      The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

        I (respectfully) disagree with your disagreement.

        Do you honestly think, looking at the OP's code, that he would benefit more from using Moose right now than from re-reading perlobj, perlboot, perltoot and perltooc?

        Maybe I'm an old fart, but I think that writing your own accessor factory is a rite of passage for every aspiring Perl hacker ...

      I can think of a simple way to put it. When someone's coding class method generators, it's time to point them in another direction.
      What this guy's talking about is not simple OO. It's great to do this- write your own accessor generator- I've done this a few times. Awesome- learned a ton- but really.. I wouldn't say that writing a class construction helper is part of knowing how to write a class! :-)

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://806519]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (1)
As of 2023-09-28 02:16 GMT
Find Nodes?
    Voting Booth?

    No recent polls found