View Single Post
Old 06-10-2009, 09:46 PM   #6 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

I prefer to use a space after things like if, before the opening parenthesis, and to keep curly brace pairs at the same indent level (Allman style). E.g.:

PHP Code:
if ($a == 1)
{
    echo 
'Hello world!';

The main thing, in my opinion, is to choose (or arrive at) a style and to be consistent with it rather than believing one way is any more "correct" than any other.
Salathe is offline  
Reply With Quote