Recent changes RSS feed
 

WACT Coding Standards

The WACT project uses the PEAR Coding standards with a few exceptions and additions.

PEAR Standard Exceptions

WACT makes the following exceptions to the PEAR coding standards.

Function Definitions

WACT uses the one true brace style for function definitions.

function HelloWorld() {
    echo "Hello World!";
}

This overrides the Function Defintions section of the PEAR coding standard.

Header Comment Blocks

Many Exceptions here.

This overrides the Header Comment Blocks section of the PEAR coding standard.

Naming Conventions

All classes and functions in WACT should be prefixed by ‘Wact’.

class WactExample {
}
 
function WactExample() {
}

WACT code should not use constants defined with define. Class constants should be all upper case.

WACT code should not use global variables. Does it do that anyway now? If it does, we need to talk prefixes.

This overrides the Naming Conventions section of the PEAR coding standard.

Additional Standards

Including Code

All includes in WACT must be relative to the include_path.

A file should require_once its dependencies at the top of the file.

Lazy Loading for exceptions

All exception classes should be lazy loaded.

    require_once 'wact/sample/example.xcpt.php';
    throw new ExampleException();

See WACT File Organization for more information on the .xcpt.php filename extension.

 
wact/coding_standards.txt · Last modified: 2006/12/09 17:16
 
Hosting for this site donated by Procata PHP Development