Chapter 20. moregroupware coding conventions

Table of Contents

Indenting
Naming conventions
Constants
Global variables
Control structures
Function calls
Comments
Including code
PHP code tags
Using CVS
General script structure

This is a first step of guidance to a more clear programming. It is taken from the PEAR Coding Standards which can be found at http://pear.php.net/manual/en/standards.php . These are only excerpts from that to make the main parts clear.

Indenting

Use an indent of 4 spaces, with no tabs.

For UltraEdit 32 (on Windows) Go to Advanced -> Configuration and choose the Edit tab. Check "Use spaces in place of tabs" and enter 4 in the next text field which should say something like "Tab Stop Value" + an excessive bunch of words. If you've already written code with other tab stops follow the above note and then do Format > Tabs to Spaces For hints on other editors go to the URL shown above.