Difference between revisions of "Coding Standards"

From ARK
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
The ARK coding standards follow the PEAR coding standards for PHP code. The PEAR documentation is pretty complete and should be consulted in the first instance at the [[PEAR| http://pear.php.net/manual/en/standards.php]] website.
+
The ARK coding standards follow the PEAR coding standards for PHP code. The PEAR documentation is pretty complete and should be consulted in the first instance at the [[http://pear.php.net/manual/en/standards.php| PEAR]] website.
 +
 
 +
This sets out in detail the technical standard expected of code to be contributed to the project. This is detailed and includes things such as correct use of tabs/spaces, line spacing and so forth. For more general notes of what goes where and for a more general overview of the architecture of ARK, you should familiarise yourself with the relevant parts of this wiki.
 +
 
 +
===Common Errors===
  
 
Common errors and things to watch out for:
 
Common errors and things to watch out for:
  
* Use a space after operators but not after function calls
+
* Make sure that your text editor is set up to insert 4 spaces NOT tab stops.
 +
 
 +
* Use a spaces after control structures but not after function calls
 
   function(call);
 
   function(call);
   if (operator) {
+
   if (control_structure) {
 +
 
 +
[[Category:Developer]]

Latest revision as of 14:03, 12 February 2009

The ARK coding standards follow the PEAR coding standards for PHP code. The PEAR documentation is pretty complete and should be consulted in the first instance at the [PEAR] website.

This sets out in detail the technical standard expected of code to be contributed to the project. This is detailed and includes things such as correct use of tabs/spaces, line spacing and so forth. For more general notes of what goes where and for a more general overview of the architecture of ARK, you should familiarise yourself with the relevant parts of this wiki.

Common Errors

Common errors and things to watch out for:

  • Make sure that your text editor is set up to insert 4 spaces NOT tab stops.
  • Use a spaces after control structures but not after function calls
 function(call);
 if (control_structure) {