The main reason to always use them is to avoid confusion; it's harder
to introduce bugs if you always use braces. MooTools style is to not
use them for one line statements. However, when you have an if/else,
if one of them is multiline, both get braces.
-Aaron
Sorry for any typos. Big fingers , tiny buttons.
On Feb 20, 2010, at 1:49 PM, Trevor Orr <[email protected]> wrote:
My preference is to always use the { } no matter how many statements
to execute in an if statement. What are do the rest of you use?
On Sat, Feb 20, 2010 at 1:45 PM, Sanford Whiteman <[email protected]
> wrote:
> Is it just a matter of personal preference or does it provide a
speed
> performance or is there other reasons?
· Personal preference
· Team coding standards
· Less distraction by style (less to think about while typing
if
single- and multi-statement have the same style)
· Fewer screwups when adding additional statements
· Line breaks less sensitive
-- Sandy