Login | Register
My pages Projects Community openCollabNet

propel
Reply to message

* = Required fields
* Subject
* Body
Attachments
Send reply to
Topic
Author (directly in email)
Please type the letters in the image above.

Original message

Author Alan Pinstein <apinstein@mac.com>
Full name Alan Pinstein <apinstein@mac.com>
Date 2006-09-21 07:33:25 PDT
Message I highly disagree with this one...

I used to prefer this style too, but after hunting down bugs caused
by adding a 2nd line and forgetting {} I changed my tune.

This issue gets WORSE in an open source project as someone might add
a line who's used to always having {} and introduce bugs.

I think {} should always go with "if" no matter what.

Alan


> - Personally, I like if styles like this:
>
> if ($something)
> return "something";
>
> Two lined if's without {} that is, current coding standards don't
> tell me if I can use them.