8.2. Coding Style

8.2.1. Indentation

Look at the existing codebase and try to code using the same style.

Update the ChangeLog for every commit.

Example 1. ChangeLog entry

2003-07-29  Steffen Macke <Steffen_Macke@dorsch.com.jo>

	* doc/development/dcmms_development_guide.xml: more information on 
	coding style

For variable names, use prefixes like flt, str, arr and date to indicate the variable type.

Example 2. A string variable

$strName = "test";

Variable names should be descriptive, with the exception of simple loop variables like i,j,k,l,m

Use a wrap margin of 80 characters. jEdit can provide a guiding line for this purpose: Utilities Global Options Editing Wrap Margin

Internationalize all messages visible to the end user. See Section 4 for the details.

When echoing texts from PHP, use brackets to indicate that echo() is a function.

Example 3. Echo function


Single quotes should be used wherever possible for performance reasons