Tuesday, July 20, 2010

Best Code Development Practices-II

The objective of this document is to provide common PHP software development guidelines


1) NAMING CONVENTIONS FOR FORM FIELDS (REQUIRED):

Following guidelines should be used to name various field types in forms.
a) Text Fields / Text Areas should be named as txtFirstName
b) Buttons should be named as btnSubmit
c) CheckBoxes should be named as chkPrefLang
d) Radio buttons should be named as optGender
e) Drop-down should be named as selCountry
f) Hidden Fields should be named as hdnStatus
g) Labels should be named as lblName

2) NAMING CONVENTIONS FOR SQL (REQUIRED)

a) For queries: As a convention, all SQL keywords (e.g. SELECT, FROM, ORDER BY, etc) should be all in UPPER CASE. For example,
SELECT firstName, lastName FROM users ORDER BY firstName ASC;

b) For Table/Fields: The table & field names should follow the camel case conventions. For example, i) employeeData for table name
ii) firstName for field names

c) SQL STRING VARIABLE NAME: Name the SQL Queries as per camel case conventions.
$sqlSelectEmpName = “ SELECT firstName, lastName FROM users ORDER BY firstName ASC ”;

Click Software Outsourcing
iPhone Application Development