Re: [CFV] how to mark protected items?

From: Date: Tue, 22 Jun 2004 08:34:06 +0000
Subject: Re: [CFV] how to mark protected items?
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-31081@lists.php.net to get a copy of this message
Heino H. Gehlsen wrote:
The underscores are in my opinion mere leftovers due to Zend1's lack of PPP. Now that we have a better alternative in Zend2, we should no longer require the underscores, and it should be up to the developer to determine if private or protected variables and methods should be preceded by an underscore.
In Zend1 and Zend2 we document how a property/method may be accessed via phpdoc comments. In Zend2 only code we can additionally put in a technical barrier that prevents misuse. This effectively means that if the user doesnt look at the documentation he is slapped with an error (unless the error is suppressed). Eitherway its the users job to follow the documentation and not be surprised when undocumented things go away (since we do require phpdoc comments the API is actually by definition fairly well documented - atleast the @access tags make this fairly clear). The underscore therefore was always sort of a hungarian notation to prevent people from stupidly not following the documentation. So to say the underscore just screams "hey I am not public!". So argueing that it its a Zend1 thing is incorrect. The question is if we think this hungarian style notation is what we want or not (especially since we dont do this for types - then again that wouldnt make much sense most of the time in a typeless language). regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07

« previous php.pear.dev (#31081) next »