What I do is reverse the order of the operands:

if (true == result)

or

if (0 == result)

and so forth. If you get the operator wrong, you'll get a compile
error.

Kostya's style works too.



On Mar 15, 11:36 am, Kostya Vasilyev <[email protected]> wrote:
> 15.03.2011 21:29, David Williams ?????:
>
> > Thanks.  I'll go smack myself around the face a little now.
>
> Better yet - get in the habit of writing
>
>      if (booleanValue)
>
> or
>
>      if (!booleanValue)
>
> Without "==" or "=" :)
>
> I'm actually surprised there is no compiler warning for this.
>
> -- Kostya
>
> --
> Kostya Vasilyev --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to