Re: how to mark protected properties?
| From: | Lukas Smith | Date: | Mon, 07 Jun 2004 21:05:00 +0000 |
| Subject: | Re: how to mark protected properties? | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-30101@lists.php.net to get a copy of this message | ||
Bertrand Mansion wrote:
Lukas Smith wrote:100% pure encapsulation is not efficient 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 07Martin Jansen wrote:-1 Everything should be protected by default in OO code. PHP makes everything public by default, that's just a design error and defeats the whole point of data encapsulation, probably due to BC. I won't prefix all my instance vars with _. Users are free to refer to the API documentation.On Mon Jun 07, 2004 at 03:2800PM -0400, Daniel Convissor wrote:+1So, should @private items be preceeded by "_", nothing, or something else?I think protected members should be prefixed with "_" as well, because they are semantically more similar to private than to public members. And I also think that we should stick to this rule for PHP 5, too.