Req #3836 [Opn]: Coding standards overlook topics
| From: | wiesemann@php.net | Date: | Sat, 05 Aug 2006 08:46:00 +0000 |
| Subject: | Req #3836 [Opn]: Coding standards overlook topics | ||
| References: | 1 | Groups: | php.pear.doc |
| Request: | Send a blank email to pear-doc+get-8234@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=3836&edit=1
ID: 3836
Updated by: wiesemann@php.net
Reported By: drewish at katherinehouse dot com
Status: Open
Id: 3836
Type: Feature/Change Request
Package: Documentation
PHP Version: Irrelevant
New Comment:
> 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
Previous Comments:
------------------------------------------------------------------------
[2006-08-04 08:58:47] pajoye at php dot net
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-04 08:26:39] wiesemann at php dot net
I'd like to add here, that the CS section in the manual does not state
that using die() is not allowed.
------------------------------------------------------------------------
[2005-03-16 03:37:15] drewish at katherinehouse dot com
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.
------------------------------------------------------------------------
[2005-03-16 03:03:37] 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-15 21:13:04] drewish at katherinehouse dot com
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?
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=3836&edit=1