cvs: php4 /pear CODING_STANDARDS
| From: | Jon Parise | Date: | Tue, 17 Jul 2001 23:55:10 +0000 |
| Subject: | cvs: php4 /pear CODING_STANDARDS | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-291@lists.php.net to get a copy of this message | ||
jon Tue Jul 17 19:55:10 2001 EDT
Modified files:
/php4/pear CODING_STANDARDS
Log:
Describe the standards for function naming and private methods.
Index: php4/pear/CODING_STANDARDS
diff -u php4/pear/CODING_STANDARDS:1.6 php4/pear/CODING_STANDARDS:1.7
--- php4/pear/CODING_STANDARDS:1.6 Sun May 6 19:44:06 2001
+++ php4/pear/CODING_STANDARDS Tue Jul 17 19:55:10 2001
@@ -2,7 +2,7 @@
|| PEAR Coding Standards ||
===========================================================================
-$Id: CODING_STANDARDS,v 1.6 2001/05/06 23:44:06 ssb Exp $
+$Id: CODING_STANDARDS,v 1.7 2001/07/17 23:55:10 jon Exp $
-------------
[1] Indenting
@@ -123,6 +123,18 @@
return true;
}
+Functions should be named using the "studly caps" style (also referred to as
+"bumpy case" or "camel caps". The initial letter of the name is lowercase,
+and each letter that starts a new "word" is capitalized. Some examples:
+
+ connect() getData() buildSomeWidget()
+
+Private methods (meaning methods that an intented to be called only from
+within the same class; PHP does not yet support truly-enforceable private
+namespaces) are preceeded by a single underscore. For example:
+
+ _sort() _initTree() _validateInput()
+
------------
[5] Comments
@@ -191,7 +203,7 @@
// | Your Name <you@example.com> |
// +----------------------------------------------------------------------+
//
-// $Id: CODING_STANDARDS,v 1.6 2001/05/06 23:44:06 ssb Exp $
+// $Id: CODING_STANDARDS,v 1.7 2001/07/17 23:55:10 jon Exp $
There's no hard rule to determine when a new code contributer should be
added to the list of authors for a given source file. In general, their