Previous Up Next
Components Form Tools File Structure
Coding Conventions

Coding Conventions

Guidelines

The coding conventions used in Form Tools aren't rocket science. The goal is to provide simple, clear, readable source code which any newbie developer can work with. That said, here's a summary of the more salient conventions:

  • Functional, not object-oriented.

  • Underscore notation used in variable and function naming, not camel or anything insane like Hungarian.

  • Files beginning with an underscore are include files, included in a file with the same name, minus the underscore. e.g. _index.php is included in index.php. The _index.php file contains the main PHP for the other page. The idea is to reduce intermingling of the HTML and PHP.

  • Extensive commenting! Commenting format used for conjunction with phpDocumentor (see phpdoc.org)

  • 2 space indentation.

  • Function relating to forms, submissions and accounts are placed in their own separate libraries.

  • Emphasis on DHTML usage over server-side for receptiveness and speed.

  • Most functions begin with a ft_ prefix to act as a "namespace" for the functions. The exceptions to this rule are helper functions which begin with _ft_ and the form validation function which has its own name (validateFields) since it's an standalone script.

Previous Up Next
Components Form Tools File Structure

Documentation generated on Mon, 03 Mar 2008 22:31:43 -0800 by phpDocumentor 1.3.1