Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re^2: Private methods

by Ovid (Cardinal)
on Mar 10, 2003 at 01:08 UTC ( #241642=note: print w/replies, xml ) Need Help??


in reply to Re^2: Private methods
in thread Private methods

Surely by definition, if you can override a method it isn't private :-)

Heh :) Perl is less modest about its private parts. When "private" methods are merely a matter of convention, scalability suffers. You bring this up quite nicely with you _something_else example. If Perl's OO was cleaner, fewer programmers would struggle with the subtle bugs of accidentally overriding private methods. Considered in that light, perhaps all private methods should be implemented via coderefs to ensure that this problem just goes away.

The more I consider OO in Perl, the more I'm inclined to agree with tye's insistence that inheritance should be avoided (at least in Perl).

Cheers,
Ovid

New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text)

Replies are listed 'Best First'.
Re^4: Private methods
by adrianh (Chancellor) on Mar 10, 2003 at 09:27 UTC
    The more I consider OO in Perl, the more I'm inclined to agree with tye's insistence that inheritance should be avoided (at least in Perl)

    Well - I wouldn't go quite that far :-) Although inheritance is often overused in designs - regardless of the implementation language.

    As annoying as these issues can be I find I don't get bitten by them very often. The problem is that it can be a complete bugger to track and fix when it does happen.

    There is also the problem that the lack of these abilities, even if they don't impact many real world situations, can be used in those pointless "perl cannot be used for coding in the large" flame fests :-)

Re^4: Private methods
by Aristotle (Chancellor) on Mar 11, 2003 at 02:57 UTC
    Perl is less modest about its private parts.
    That's a keeper. :)

    Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2021-09-17 07:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?