Re: [CFV] how to mark protected items?
| From: | Heino H. Gehlsen | Date: | Tue, 22 Jun 2004 08:11:45 +0000 |
| Subject: | Re: [CFV] how to mark protected items? | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-31080@lists.php.net to get a copy of this message | ||
> 1) "How should protected properties (variables) be marked?"
a) no special indicators.
> 2) "How should protected methods be marked?"
a) no special indicators.
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 the primary reason for introducing the underscores wasn't to allow
the developer himself to differentiate between 'private' and 'public'
variables and methods - it was let the users know which 'internal' stuff
they should not mess with. This could however still be true with Zend2 if
one had to leave a method or variable visible/public due to some
weird/complex design, and in that case the underscores would still mean
"don't touch my visible private stuff". In such cases the underscores might
again come in handy, but otherwise they should definitely not be an
requirement (leave it up to the individual developers - its private
stuff ;-) just because a group of developers have become used to seeing
the underscores in their code.
Those of you who want to force the rest of us to use underscores when it's
no longer necessary, do you mess up your java code with such garbage also?
Take a breath and smell the fresh air of Zend2 and don't force other
developers to mess up their code because of your old habits...
regards,
Heino