incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Mclean <>
Subject Re: [Proposal] Add PostCodeValidator and PostCodeFormatter to the SDK
Date Mon, 12 Mar 2012 21:13:58 GMT

> One more clarification.  If there is an else it should then be
>    if (expresion)
>    {
> 	statement;
>    }
>    else
>    {
> 	statement;
>    }

Even for single line statements?

I've seen quite a lot of missing braces in if/elses when there only one line. I've also seen
braces for single line if statements  in the existing code base.

Picking a file I've look at recently ( it contains code like this. 
 if (!suppressEvents)

 if (obj == null)
     //return true;

 if (_trigger)
     return _trigger;
  else if (_source)
      return _source as IEventDispatcher;

I particularly like the second example :-) I guess it possible that the braces were added
after the return true was commented out so not to have the condition effect the line below.
The blank line in the 3rd example certainly doesn't help comprehension of the code.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message