in reply to Re: OOP's setter/getter method - is there a way to avoid them?
in thread OOP's setter/getter method - is there a way to avoid them?

Thank you, Discipulus. I'll look into all the sources that you have suggested. Damian Conway's rules were particulary useful. And, yes, thank you for confirming that OOP is slower - I think by 30%. If I remember it correctly, the author Randal Schwartz had mentioned this piece of information in his book. However, it was in 2003 that he made this statement. I'm unsure how OOP behaves on present day computers assuming that the trend for computer performance is to improve each year. I have heard of Moose and Moo lately but I do not have any idea what they could actually do. I'll look into it as well. If you have the time, I'd appreciate it if you could share with me the author of Perl Cookbook. :)

  • Comment on Re^2: OOP's setter/getter method - is there a way to avoid them?

Replies are listed 'Best First'.
Re^3: OOP's setter/getter method - is there a way to avoid them?
by Preceptor (Deacon) on Oct 27, 2015 at 10:37 UTC

    Well, it's likely to be consistent in that it'll always be _slower_. But that's never been the point of OO. The point is to segregate and isolate chunks of code such that you always know where you're looking for problems and tracing bugs. And 10 years of Moore's law means that speed is increasingly not a concern - and when it is, it's time to whip out a profiler, and decide on a risk managed way, if you can afford to rewrite

Re^3: OOP's setter/getter method - is there a way to avoid them?
by hippo (Archbishop) on Oct 27, 2015 at 10:08 UTC
    I'd appreciate it if you could share with me the author of Perl Cookbook. :)

    Perl Cookbook is written by Tom Christiansen and Nathan Torkington. Tom also co-wrote Programming Perl (among other highly-regarded endeavours).