Difference between revisions of "Developers Standards"

From Zen Cart(tm) Wiki
Jump to: navigation, search
m (Indentation)
 
(19 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 
{{Template:menuBarDevelopers}}
 
{{Template:menuBarDevelopers}}
 +
==Zen Cart® Coding Standards==
 +
Currently the Zen Cart® Team is using a mix of the pear/phpBB coding standards docs to provide the categories as below. 
 +
 +
 +
The coding standards posted here are what we strive for. They are not a definition of how code is currently written.
 +
So, if the code you get does not match posted standards, don't be surprised. It's a long and arduous battle to convert all core code.
  
Zen Cart Coding Standards
 
Currently I am using a mix of the pear/phpBB coding standards docs to provide the categories as below. 
 
  
 
== Indentation ==
 
== Indentation ==
 +
Currently, the standard is not to use hard tabs, and to use two spaces per indent.
 +
 +
 +
The Zen Cart® Team's thoughts are that regardless of whether you use tabs or spaces for indents, anything more than two spaces can quickly lead to indent chaos. The argument then becomes whether indents should be hard tabs or soft spaces.
 +
 +
 +
The PHP FIG standard is shifting the PHP industry to use spaces instead of tabs.
 +
 
== Control Structures ==  
 
== Control Structures ==  
 +
 +
 
== Function Calls ==
 
== Function Calls ==
 +
 +
 
== Function Definitions ==
 
== Function Definitions ==
 +
 +
 
== Comments ==
 
== Comments ==
 +
 +
 
== Including Code ==
 
== Including Code ==
== PHP Code Tags ==  
+
 
 +
 
 +
== PHP Code Tags ==
 +
Never use short open tags <? or asp tags <%; always use the full <?php ?> tags.
 +
 
 +
 
 
== Header Comment Blocks ==
 
== Header Comment Blocks ==
 +
 +
 
== Example URLs ==
 
== Example URLs ==
== Maning Conventions ==
+
 
 +
 
 +
== Naming Conventions ==
 
=== Variable Names ===
 
=== Variable Names ===
 +
 +
 
=== Function Names ===
 
=== Function Names ===
 +
 +
 
=== Class Names ===
 
=== Class Names ===
 +
 +
 
== Code Optimisations ==
 
== Code Optimisations ==
 +
 +
 
== SQL/SQL Layout ==  
 
== SQL/SQL Layout ==  
 +
 +
 
== File Locations ==
 
== File Locations ==
 +
 +
 
== Miscellaneous ==
 
== Miscellaneous ==

Latest revision as of 19:27, 18 February 2015

Zen Cart® Coding Standards

Currently the Zen Cart® Team is using a mix of the pear/phpBB coding standards docs to provide the categories as below.


The coding standards posted here are what we strive for. They are not a definition of how code is currently written. So, if the code you get does not match posted standards, don't be surprised. It's a long and arduous battle to convert all core code.


Indentation

Currently, the standard is not to use hard tabs, and to use two spaces per indent.


The Zen Cart® Team's thoughts are that regardless of whether you use tabs or spaces for indents, anything more than two spaces can quickly lead to indent chaos. The argument then becomes whether indents should be hard tabs or soft spaces.


The PHP FIG standard is shifting the PHP industry to use spaces instead of tabs.

Control Structures

Function Calls

Function Definitions

Comments

Including Code

PHP Code Tags

Never use short open tags <? or asp tags <%; always use the full <?php ?> tags.


Header Comment Blocks

Example URLs

Naming Conventions

Variable Names

Function Names

Class Names

Code Optimisations

SQL/SQL Layout

File Locations

Miscellaneous