Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Overhead vs. ease of use in OOP

by fletcher_the_dog (Friar)
on Oct 17, 2003 at 20:51 UTC ( [id://300155]=note: print w/replies, xml ) Need Help??


in reply to Overhead vs. ease of use in OOP

I find it interesting how quick people are to judge someone elses background. perl is the only language I have ever used in the real world. Granted that has only been about two years, and there is a lot I don't know about perl, but it seems ironic to me that some would say "don't do it this way because it will mean you won't have flexibility". I did a little bit of java and c++ in school, and I liked the way that they have their object systems. I don't think that it is being disloyal to perl to say that. This is adding another way to do it, not taking away from what already exists. I have used things like $self->{variable} over and over and that is why I hate them. I look forward to perl6 when such access to attributes will be built in. I don't really care if you don't want to use this kind of thing, What I would really like to know is how big of an overhead does using tie really cause? What are some of the risks of using 'local'?

Replies are listed 'Best First'.
Re: Re: Overhead vs. ease of use in OOP
by chromatic (Archbishop) on Oct 18, 2003 at 00:25 UTC
    I don't really care if you don't want to use this kind of thing

    You did ask, though.

    is how big of an overhead does using tie really cause?

    It's at least one more method call per operation, not to mention that it's likely the method is implemented in Perl, not C. There's some overhead there too.

    cause? What are some of the risks of using 'local'?

    You give up a modicum of encapsulation for the potential of scary action at a distance. The members of whichever object you're currently working with are globally accessible and modifiable. You might as well not bless hashes, in that case.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2024-04-26 02:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found