Re: [PEPr] Comment on PHP::Debug
| From: | Lukas Kahwe Smith | Date: | Thu, 12 Apr 2007 12:17:12 +0000 |
| Subject: | Re: [PEPr] Comment on PHP::Debug | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-46205@lists.php.net to get a copy of this message | ||
Christian Weiske wrote:
So general advise is the following: - If the class method/variable is to be used from outside, make it public - If it is to be used from inside the class only, make it protected - If the method is mission critical and/or will stop working when only the slightest detail is changed, or it is very very very clear that the functionality can be /only/ implemented this way (and/or another way would be dangerous), make it private.I think Stefan's question was more what should you do as "default" for things where you have not had time to think through the implications? Basically with "protected" you are being "friendly" to extending, but it also means that you now have committed to a certain API. Since we do not allow BC breaks in the same major version number, the default should probably be "private", although authors are very much encouraged to work on making as much "protected" as possible (and certainly anything that is necessary). I think the real problem is to ensure that everybody ensures the implications of the choice. regards, Lukas