Difference between revisions of "Developers Standards"

From Zen Cart(tm) Wiki
Jump to: navigation, search
m
Line 10: Line 10:
 
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.
 
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 witha convincing argument otherwise,(this is mainly because the tab /t can be interpreted differentky accorss OS's and editorsm where as a space is always interpreted the same whatever.  
+
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.  
  
 
   
 
   

Revision as of 00:08, 31 December 2005

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

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

Maning Conventions

Variable Names

Function Names

Class Names

Code Optimisations

SQL/SQL Layout

File Locations

Miscellaneous