Re: Howdy (new in here)
| From: | Micky Hulse | Date: | Wed, 16 Feb 2011 01:43:57 +0000 |
| Subject: | Re: Howdy (new in here) | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-311351@lists.php.net to get a copy of this message | ||
On Tue, Feb 15, 2011 at 2:00 PM, David Harkness
<david.h@highgearmedia.com> wrote:
> I use K&R. I started with it just as shown but as monitors increased in size
> I stopped cuddling the else so it's now on its own line, aligning the if,
> elseif, and else nicely. One of the developers at my company uses the
> truly abominable Horstmann style which makes moving code around a serious
K&R here, unless existing guidelines are in place... CodeIgniter
framework and ExpressionEngine wants folks to use Allman.
I use a programming lang called Objectscript at work, and it will give
an error if there is not space between the "if" and the first "("...
For example:
if(...) <-- errors out.
I have had to learn to put a space in there:
if (...)
So I don't forget, I do this for everything now... I actually kinda
like the breathing room now.
Speaking of spaces, I am not a fan of putting spaces around the argument:
if ( foo == baz ) {
I definitely prefer this:
if (foo == baz) {
More on spaces: I am so glad that most PHP folks I know use tabs for
indentation and not spaces! Oops, did I just go there? Oh no I didn't!
Good thread! Thanks for that link Tedd!
Cheers,
Micky