Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: OO automatic accessor generation

by Jenda (Abbot)
on Nov 11, 2009 at 15:34 UTC ( [id://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.

Jenda
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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-20 03:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found