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 hlellelid
Full name Hans Lellelid
Date 2006-09-21 07:42:40 PDT
Message I agree with Alan here. I mandate the {} in code we write at work too.
So many bugs because people add code (like debug statements) and forget
that they weren't in a {} block.

Hans

Alan Pinstein wrote:
> 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.
>
>
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> For additional commands, e-mail: dev-help at propel dot tigris dot org
>