summaryrefslogtreecommitdiff
path: root/CODING_STANDARDS
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2003-05-23 10:38:43 (GMT)
committerDerick Rethans <derick@php.net>2003-05-23 10:38:43 (GMT)
commitb94bd055eeb163d591dc203ac26a0ed8837a70a3 (patch)
tree743dfd372eb4db821e55acda49f337eff281203a /CODING_STANDARDS
parent2f15b2062ce9405840cdfe13677c0958cc3c6c53 (diff)
downloadphp-b94bd055eeb163d591dc203ac26a0ed8837a70a3.tar.gz
- Update codinf standards with the posted RFC (results from PEAR Meeting)
Diffstat (limited to 'CODING_STANDARDS')
-rw-r--r--CODING_STANDARDS34
1 files changed, 31 insertions, 3 deletions
diff --git a/CODING_STANDARDS b/CODING_STANDARDS
index 12fbd3a..bf9854b 100644
--- a/CODING_STANDARDS
+++ b/CODING_STANDARDS
@@ -104,8 +104,7 @@ Naming Conventions
'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,7 +125,7 @@ Naming Conventions
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++) ...).
@@ -134,6 +133,35 @@ Naming Conventions
[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
----------------------