[TYPO3-dev] Official coding guidelines of TYPO3

Andy Grunwald [wmdb] andy_grunwald at arcor.de
Fri Apr 17 20:06:32 CEST 2009


Hey,

when i looked at TYPO3 source code i see many different styles of source 
  code.
For example:
$var=$value; vs. $var = $value;

switch($var){
   case 1: echo 'hello'; break;
   default: echo 'error';
}

vs.

switch($var){
   case 1:
     echo 'hello';
   break;
   default:
     echo 'error';
}

and so on...

In a big project, i think strict coding guidelines are a good thing. The 
source code have the same format so it is easy to read.

Another advantage is the detection of duplicate lines by an automatic 
tool (for example "phpcgd").

In my search for the official coding guidelines i`ve found 3 versions:
typo3.org: last update: 28.04.2007 11:36
http://typo3.org/documentation/document-library/core-documentation/doc_core_cgl/current/

wiki.typo3.org: draft version
http://wiki.typo3.org/index.php/TYPO3_Coding_Guidelines_-_Notes

Dmitry Dulepovs blog: result of discussion by TYPO3-(Core-)Team
http://dmitry-dulepov.com/article/get-typo3-coding-guidelines-here.html

So i dont know which coding guidelines are to use. Any idea?

Another idea is to create a pre commit action to the svn to check of the 
rules for coding guidelines to defend wring formatted code in the svn 
(see PHP_CodeSniffer).

Have a nice day,
Andy




More information about the TYPO3-dev mailing list