[AppDB] CODING_STANDARD
Jonathan Ernst
Jonathan at ErnstFamily.ch
Tue Dec 14 06:08:29 CST 2004
This patch sets variable naming convention that should be used in the
appDB code.
CHANGELOG:
- added variable naming guidlines
File changed:
- CODING_STANDARD
-------------- next part --------------
Index: CODING_STANDARD
===================================================================
RCS file: /home/wine/appdb/CODING_STANDARD,v
retrieving revision 1.2
diff -u -r1.2 CODING_STANDARD
--- CODING_STANDARD 11 Dec 2004 19:40:01 -0000 1.2
+++ CODING_STANDARD 14 Dec 2004 12:07:12 -0000
@@ -70,3 +70,28 @@
1) it is off by default in php 4.1+
2) it is more secure
3) it makes it easier to understand where your vars are comming from (forms, session, etc.)
+
+- variables naming
+variables that don't come from outside your script (i.e. that arent fetched from superglobals) should be named this way:
+
+var_type + "_" + var_name
+
+Where var type is one of:
+Scalar types:
+int Integer
+dbl Float-point, double
+str String
+bln Boolean
+Compound types:
+arr Array
+obj Object
+Special type:
+res Resource
+
+the rest of the variable's name is using camel style
+exemples:
+$arr_users
+$int_TopicId
+$res_recordSet
+$str_query
+$res_result
\ No newline at end of file
More information about the wine-patches
mailing list