[TYPO3-50-general] CGL discussions (misced topics)

Sebastian Fischer sebastian at fischer.im
Tue Jun 9 13:40:10 CEST 2009


Bastian Waidelich wrote:
> Karsten Dambekalns wrote:
> 
> Hi Karsten,
> 
>> Thinking about it I start to dislike if/else without braces at all [...]
>> What do the others think?
> 
> Absolutely +1,
> 
> It's one additional line but makes the whole thing more consistent and 
> IMO even more readable if you're used to it:
> 
> Bastian

Hi Bastian,

in addition, it makes code somehow more secure, because no mistakenly 
commented or uncommented line could break the code.

"bad style":
if (condition)
	echo "output1";
else
	echo "output2;

"good style":
if (condition) {
	// debug(something); // don't remove the first commentslashes
	echo "output1";
} else {
	echo "output2";
}

So definitly +1 for curlycaps.

Greetings
Sebastian


More information about the TYPO3-project-5_0-general mailing list