Re: Re: 1 class = 1 file?
| From: | Greg Sherwood | Date: | Sun, 13 May 2007 22:15:09 +0000 |
| Subject: | Re: Re: 1 class = 1 file? | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-46754@lists.php.net to get a copy of this message | ||
Mark Wiesemann wrote:
If a rule like this were to be introduced (and I'd really love to see something solid in the standards) then we'd need to have some way of determining if a class is internal so that we can ensure that the standard is being followed. In my experience a standard that is not enforced, or hard to enforce, is going to be ignored. I'd actually vote for one class per file no matter how the class is intended for use at the time of release. I think it's a clearer standard that is easier to follow because the developer doesn't need to decide if the rule applies to them. Plus, you never know how your code is going to be used in the future. Maybe those internal classes will be extended by someone else, in which case they become public without your knowledge. GregIMO and for clarity, it's one class per file. Having too many exceptions to the rule just weakens the "standard". And maybe - if it's not hidden somewhere already - this should be added to the docs.Well, the rule Lukas, David and (later also) I were talking about makes sense IMHO. Only internally used classes would be put together with other classes, public classes would still go into new files. Exception classes are public and used by user code, and would therefore also go into a new file.