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'?
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.
| [reply] |
|