Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^5: OO automatic accessor generation

by chromatic (Archbishop)
on Nov 11, 2009 at 20:58 UTC ( [id://806592]=note: print w/replies, xml ) Need Help??


in reply to Re^4: OO automatic accessor generation
in thread OO automatic accessor generation

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?

Unless the OP wants to write a new implementation of an object system, I do. (I suspect most people using objects in Perl 5 do so because they have some project to finish, not because they want to understand how an object system works or the syntax for Perl 5 metaprogramming.)

Replies are listed 'Best First'.
Re^6: OO automatic accessor generation
by Herkum (Parson) on Nov 12, 2009 at 19:04 UTC

    I suspect most people using objects in Perl 5 do so because they have some project to finish, not because they want to understand how an object system works

    At this point, people who are just getting things done, aren't they likely going to make bad decisions? This is even more likely when you don't understand what you are working with. So they do something stupid and get away with because the effects are not obvious or not crop up that often.

    Not understanding what you are working on will eventually come back to bite you in some way or another. Looking at all the software that I have had to work with over the years it has been consistent. Few people bother to understand what they are trying to do and eventually screw it up leaving a mess for someone else to clean up.

      Not understanding what you are working on will eventually come back to bite you in some way or another.

      What part of Moose hides the effective understanding of classes, instances, attributes, methods, and method dispatch from the user? What part of blessed hashes bestows greater understanding?

      You're making a straw man argument that people who roll their own object systems understand more about the problem domain than people who use well-designed, well-tested, robust existing object systems, as if throwing just enough code together to solve what you think is the problem produces complete understanding.

      If that were the case, we wouldn't have Matt's Script Archive. We wouldn't be able to find at least three and usually seven bugs in hand-rolled CGI parsers. (We wouldn't see people storing plaintext passwords in databases.)

        I not saying they should write their own and publish it. The argument I am making is that that people who have tried to roll their own are more likely to understand issues that crop up, because they encounter them as problem. Therefore are more like to understand and appreciate what a OO system provides.

Re^6: OO automatic accessor generation
by WizardOfUz (Friar) on Nov 12, 2009 at 09:07 UTC

    Well, I assumed that the OP wants to learn OOP in Perl, not to finish some project on a deadline. And I (still) believe that there are people out there who want to understand the basics of a programing language before trying to "get something done" with it.

      I (still) believe that there are people out there who want to understand the basics of a programing language before trying to "get something done" with it.

      Why stop at blesssing hashes then and not have them write their own method dispatch systems? The blessed-referent, package-is-a-class, method-is-a-sub bare-bones approach of Perl 5 doesn't teach much about OO. It instead teaches a lot about how to smoosh together a few orthogonal concepts into the skeleton of an OO system.

      To whom is that valuable?

        To whom is that valuable?

        To anyone wanting to understand ~99% of the code on CPAN, for example.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-25 23:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found