Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Re: Re^2: Private method variations

by duff (Parson)
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

$ # 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.

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://333053]
[choroba]: Heh: I downvoted because...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (10)
As of 2018-02-22 15:17 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (294 votes). Check out past polls.