Re[2]: [PEAR-DEV] [PEPr] +1 for XML::XML_Feed_Parser

From: Date: Sun, 23 Oct 2005 20:58:43 +0000
Subject: Re[2]: [PEAR-DEV] [PEPr] +1 for XML::XML_Feed_Parser
References: 1 2 3 4 5 6 7  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-40262@lists.php.net to get a copy of this message
||*()*|| [\..konnichi wa, ogenki desu ka, Arnaud../] AL> As far as I can see Coding Standards do not say you should use AL> concatenation over inlining, end of the story. Some arguments were given AL> in favor of the former, in the end the developer decides which form to use. It would be nice this conslusion to be included as notice in CS, so developers will not spot debates over and over again. Another thing (rather unusual for me) I'd like to see there - "respect to other's coding style if it is not is described in CS". Here is the patch for review and rephrase. Although I can commit it I afraid my touch of this sacred text can be considered chaotic act resulting in immediate prosecution. =) WBR.techtonik -- (B)uilding, (A)ntenna, (S)pan and (E)arth * terminal velocity - 54m/s, 305m *

--- standards_old.xml Sun Oct 23 22:57:50 2005 +++ standards.xml Sun Oct 23 22:54:56 2005 @@ -6,17 +6,21 @@ <note> <simpara> The PEAR Coding Standards apply to code that is part of the official - PEAR distribution (that is, either distributed with PHP or available - for download from the PHP PEAR repository). + PEAR distribution. Coding standards often abbreviated as CS among + developers and they aim to keep code consistent to be easily readable + and maintainable by most of PEAR folks. </simpara> </note> <sect1 id="standards.indenting"> <title>Indenting and Line Length</title> <para> - Use an indent of 4 spaces, with no tabs. If you use Emacs to edit PEAR - code, you should set indent-tabs-mode to nil. Here is an example mode - hook that will set up Emacs according to these guidelines (you will - need to ensure that it is called when you are editing PHP files): + Use an indent of 4 spaces, with no tabs. This helps to avoid problems + with diffs, patches, CVS history and annotations. + </para> + <para> + For Emacs you should set indent-tabs-mode to nil. Here is an example + mode hook that will set up Emacs (ensure that it is called when you + are editing PHP files): <programlisting role="elisp"> <![CDATA[ (defun php-mode-hook () @@ -30,7 +34,7 @@ ]]> </programlisting> </para> - <para>Here are vim rules for the same thing: + <para>Here are Vim rules for the same thing: <programlisting role="vim"> <![CDATA[ set expandtab @@ -41,11 +45,8 @@ </programlisting> </para> <para> - It is recommended that you break lines at approximately 75-85 characters. - There is no standard rule for the best way to break a line, use your - judgment and, when in doubt, ask on the <ulink - url="mailto:&email.pear.qa;">PEAR Quality Assurance mailing - list</ulink>. + It is recommended to keep lines at approximately 75-85 characters long + for better code readability. </para> </sect1> @@ -565,9 +566,7 @@ This section applies only to packages using CVS at cvs.php.net. </simpara> <para> - Include the &dollar;Id&dollar; CVS keyword in each file. As each file - is edited, add this tag if it's not yet present (or replace - existing forms such as <quote>Last Modified:</quote>, etc.). + Include the &dollar;Id&dollar; CVS keyword in each file. <!-- <note> <simpara> @@ -827,6 +826,20 @@ </para> </sect1> + <sect1 id="standards.bestpractices"> + <title>Best practices</title> + <para> + There are other things not covered by PEAR Coding Standards which + are mostly subject of personal preference and not directly related + to readability of the code. Things like "single quotes vs double + quotes" are features of PHP itself to make programming easier and + there no reasons not use one way in preference to another. Such + best practices are left solely on developer to decide. The only + recommendation could be made to keep consistency within package + and respect personal style of other developers. + </para> + </sect1> + <sect1 id="standards.sample"> <title>Sample File (including Docblock Comment standards)</title> <para>
« previous php.pear.dev (#40262) next »