Report new bug | New search | Development Roadmap Status: Open | Feedback | All

Request #3836 Coding standards overlook topics
Submitted: 2005-03-16 02:13 UTC
From: drewish Assigned: cweiske
Status: Closed Package: Documentation
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2005-03-16 02:13 UTC] drewish
Description: ------------ I feel that there are two, relatively minor, omissions in the existing PEAR coding standards. Many outside PHP projects adopted the coding standards so it seems to me that you ought to try to be thorough. * Class to file mapping. Should each class be in a file of it's own? Most developers seem to follow this convention but I can't find a definitive answer. * Naming of abstract classes and interfaces. Should incomplete classes have a name to identify them as such?

Comments

 [2005-03-16 08:03 UTC] smith at backendmedia dot com
I think Toby started an RFC a while back, but he in the end didnt persue it to the end. I also agree this should be in the CS. One of the tricky topics was if non public classes need to reside in their own file as well or not. There are also other topics like multiline conditions that are not in the CS. All in all most people see the CS as a pandoras box in glass. Do not open it to add anything, cause the result could be very unpleasent quickly.
 [2005-03-16 08:37 UTC] drewish
I can understand the reluctance to start making changes. It's practically inviting religious warfare. That said, I think even acknowledging that there is no agreed upon standard is better than omitting it.
 [2006-08-04 12:26 UTC] wiesemann (Mark Wiesemann)
I'd like to add here, that the CS section in the manual does not state that using die() is not allowed.
 [2006-08-04 12:58 UTC] pajoye (Pierre-Alain Joye)
die() is allowed, in very rare cases, when the situation requires it. If you add it to the CS, please try to say that it is not recommended to use die but in extremely rare cases.
 [2006-08-05 08:45 UTC] wiesemann (Mark Wiesemann)
> die() is allowed, in very rare cases, when the situation > requires it. Yes, okay. We found yesterday this die('Checksum error on entry '.$this->currentFilename); in File_Archive, which is very bad error handling and makes it unusable without patching the code. > If you add it to the CS, please try to say that it is not > recommended to use die but in extremely rare cases. For now, this was only a comment, so it does not get lost. In longer terms, we should have a new page in the CS section that talks about error handling: - PEAR_Error in PHP 4 - PEAR_Exception in PHP 5 - using die/exit
 [2009-05-05 02:08 UTC] cweiske (Christian Weiske)
-Status: Open +Status: Closed -Assigned To: +Assigned To: cweiske
The issue has been resolved by the PEAR2 Coding standards: http://pear.php.net/manual/en/pear2cs.rules.php