Difference between revisions of "Developers Standards"

From Zen Cart(tm) Wiki
Jump to: navigation, search
m (Maning Conventions)
Line 23: Line 23:
 
== 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 ==

Revision as of 02:18, 1 January 2006

Zen Cart Coding Standards Currently I am using a mix of the pear/phpBB coding standards docs to provide the categories as below.

BTW, 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 suprised. Its a long and ardous battle to convert all core code.

Indentation

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

My thoughts are this, regardless of whether you use tabs or spaces for indents, anything more than 2 spaces can quickly lead to indent hell. the argument then becomes whether indents should be hard tabs or soft spaces.

I have to say I prefer soft spaces. Unless someone can come up with a convincing argument otherwise,(this is mainly because the tab /t can be interpreted differently across OS's and editors, whereas a space is always interpreted the same whatever.


Control Structures

Function Calls

Function Definitions

Comments

Including Code

PHP Code Tags

Header Comment Blocks

Example URLs

Naming Conventions

Variable Names

Function Names

Class Names

Code Optimisations

SQL/SQL Layout

File Locations

Miscellaneous