Re: parent_ctor()

From: Date: Tue, 18 Jul 2000 17:24:50 +0000
Subject: Re: parent_ctor()
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-24994@lists.php.net to get a copy of this message
Hi Kristian! On Tue, 18 Jul 2000, Kristian Köhntopp wrote: > David Hjortso wrote: > > Private functions and variables. > > If you do this, people will cry for functionality to access > things marked private despite the fact that these are marked > private within 10 seconds of deployment of this feature. I > don't speak C++ fluently, but isn't this what "friends" do > in C++? Hmm, I though 'friend' was an ugly hack in C++, and IMHO Java was intended to avoid any past mistakes and build a real OO, and it has no friends (no virtual, no multi-inherit, so on). > The first question I ask: Is "private" functionality worthwhile? > Which problem exactly are you trying to solve with "private" > instance variables and instance methods? `incapsulation'? > And what shall the semantics of "private" exactly be? > YMMV but I found `__' trick cool in Python. > - Shall it generate an error and halt the interpreter if > you are trying to access a private variable or method? > You'll most definitely "friends" then. what happends in C++ when you tried that? it doesn't compile. > - Shall it generate a suppressable warning instead, but > execute the access normally (would make implementing a > "friends mechanism" obsolete)? this would encourage concept ignorance and bad practices... by 2c. regards, -- teodor

« previous php.dev (#24994) next »