[TYPO3-dev] [TYPO3-core] New TYPO3 Coding Guidelines

Bastian Waidelich bastian at typo3.org
Sat Jul 11 17:10:01 CEST 2009


Mathias Schreiber [wmdb >] wrote:

Hi!

> The new whitespace-after-everything style makes me wanna throw up

It took quite a while for me too to get used to all those spaces. But 
now I wonder how I could be in doubt about the better readability in the 
first place..

And one more thing about concatenation in general: It's mostly bad ;)
Instead of building HTML content in the PHP code for instance, one might 
just use a template based approach.
And instead of
$message = 'This is '.$name.' Name';
I think
$message = sprintf('This is %s Name', $name);
Or (like Benni mentionend)
$message = sprintf($GLOBALS['LANG']->getLL('message'), $name)
is more readable (I know about the performance penalty, but if printf is 
the bottleneck of your application there must be something wrong ;)

Having said that I know that we don't yet get around string 
concatenations in lots of the core classes of course because there are 
so many parts where HTML or XML is produced within PHP code..

Bastian




More information about the TYPO3-dev mailing list