cvs: php4 / CODING_STANDARDS

From: Date: Fri, 23 May 2003 10:38:43 +0000
Subject: cvs: php4 / CODING_STANDARDS
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-21220@lists.php.net to get a copy of this message
derick Fri May 23 06:38:43 2003 EDT Modified files: /php4 CODING_STANDARDS Log: - Update codinf standards with the posted RFC (results from PEAR Meeting) Index: php4/CODING_STANDARDS diff -u php4/CODING_STANDARDS:1.25 php4/CODING_STANDARDS:1.26 --- php4/CODING_STANDARDS:1.25 Fri Apr 4 12:01:09 2003 +++ php4/CODING_STANDARDS Fri May 23 06:38:43 2003 @@ -104,8 +104,7 @@ 'hw_GetObjectByQueryCollObj' 'pg_setclientencoding' 'jf_n_s_i' - - + [2] If they are part of a "parent set" of functions, that parent should be included in the user function name, and should be clearly related to the parent program or function family. This should be in the form @@ -126,13 +125,42 @@ with "_php_", and followed by a word or an underscore-delimited list of words, in lowercase letters, that describes the function. If applicable, they should be declared 'static'. - + [4] Variable names must be meaningful. One letter variable names must be avoided, except for places where the variable has no real meaning or a trivial meaning (e.g. for (i=0; i<100; i++) ...). [5] Variable names should be in lowercase. Use underscores to separate between words. + +[6] Method names follow the 'studlyCaps' (also referred to as 'bumpy case' + or 'camel caps') naming convention, with care taken to minimize the + letter count. The initial letter of the name is lowercase, and each + letter that starts a new 'word' is capitalized. + + Good: + 'connect()' + 'getData()' + 'buildSomeWidget()' + + Bad: + 'get_Data()' + 'buildsomewidget' + 'getI()' + +[7] Classes should be given descriptive names. Avoid using abbreviations + where possible. Each word in the class name should start with a capital + letter, with words underscore delimited. The class name should be prefixed + with the name of the 'parent set'. + + Good: + 'Curl' + 'Foo_Bar' + + Bad: + 'foobar' + 'foo_bar' + 'FooBar' Syntax and indentation

« previous php.cvs (#21220) next »