[TYPO3-dev] Official coding guidelines of TYPO3
Dmitry Dulepov
dmitry.dulepov at gmail.com
Fri Apr 24 15:07:16 CEST 2009
Hi!
Franz Holzinger wrote:
> The CGL says: "Use of global is not recommended. Always use
> $GLOBALS['variable']."
>
> But why do you recommend the longer way to use $GLOBALS['TYPO3_CONF_VARS
> '] instead of $TYPO3_CONF_VARS? Maybe it is because 'global'
> declarations might not work in some cases.
> It is easier to write and read if the variable names are shorter.
It is because sometimes people forget to write "global $WHATEVER" or accidentally delete it and it causes hard to catch errors.
What would you prefer: shorter code or smaller chances of errors?
> And it causes red code warnings in the EM if you follow the Coding
> Guidelines:
> No XCLASS inclusion code found in file "lib/class.tx_extkey_filename.php"
With the current EM — yes. There is a bug report about it. It needs a different regexp in the EM.
--
Dmitry Dulepov
In TYPO3 blog: http://dmitry-dulepov.com/article/have-fun-with-the-typoscript-error-hunt.html
LinkedIn: http://www.linkedin.com/in/dmitrydulepov
Twitter: http://twitter.com/dmitryd
Skype: liels_bugs
More information about the TYPO3-dev
mailing list