Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: Re^2: Private method variations

by duff (Vicar)
on Mar 01, 2004 at 20:58 UTC ( #333053=note: print w/ replies, xml ) Need Help??


in reply to Re: Re^2: Private method variations
in thread Private method variations

$self.bar() # calls public bar, not private.

This seems to imply that you can have both public and private methods/attributes with (almost) the same name. Sounds like trouble to me.


Comment on Re: Re: Re^2: Private method variations
Download Code
Re: Re: Re: Re^2: Private method variations
by TimToady (Parson) on Mar 02, 2004 at 00:46 UTC
    Gee, you can have scalars and arrays and hashes with (almost) the same name too. Somehow people manage to keep those straight...

    Really, I think it's a much worse problem to put public and private methods into the same namespace, because then not only do you have to keep the names straight, but anyone who inherits from you has to keep them straight. Private names should not show up in the public interface at all. Even within the class, it's vitally important to be able to distinguish when you're calling yourself privately from when you're calling yourself through the public interface. C++ style rules just make things completely ambiguous, visually speaking. Drives me nuts.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (13)
As of 2014-10-31 15:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (219 votes), past polls