Re: Please review our coding standards
| From: | Steven Haryanto | Date: | Wed, 02 May 2001 10:20:06 +0000 |
| Subject: | Re: Please review our coding standards | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-51142@lists.php.net to get a copy of this message | ||
At 5/2/2001 12:46 PM, Anuradha Ratnaweera wrote:
Most of your guidelines match with our practices. Here are some comments.Thanks for the comments.
1.4 WhitespacesActually I took most of the points in the 'Whitespaces' section from Guido's Python Style Guide. Most of the points are not really a big deal, but I usually suggest at least making a distinction between () for functions and () for statements. for (;;) if (..) exit(); die();- No whitespace after function or method name. Example:exit()We also use this. But I have seen others using spaces. Even there are some examples in php-manual with spaces (e.g. array_shift).
1.6 Quotes
Use whichever ones you like. But if you can use '' for simple strings,
and "" only if you need interpolation.
This should _very_slightly_ improve performance too.
Yup, though I have never thought of benchmarking this :)
4. File organization We use WML (website meta language - www.engelschall.com/sw/wml/) with make to produce single php files and do _not_ use the include feature of php. Also, we have written scripts that creates diff files between releases.Interesting. How do you find WML so far? I evaluated WML once in the past, but it seemed too complex to me then...
6. Creating documentation We use tex, and we are planning to go for texinfo.Do you also embed these in the PHP scripts? I prefer this way (like Perl's POD, Java's Javadoc, Python's docstrings), because it is much easier to synchronize with the code. Also, since I often write the documentation first and then write some code, I prefer putting them together. Steve