• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Unnecessary Boolean Warning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unnecessary Boolean Warning


  • Subject: Re: Unnecessary Boolean Warning
  • From: Greg Parker <email@hidden>
  • Date: Mon, 1 Aug 2011 13:08:26 -0700

On Aug 1, 2011, at 8:47 AM, Gordon Apple wrote:

> It’s not that I object to anyone doing it, if that makes them more
> comfortable, but a warning on ““&&” inside of “||”” is ridiculous.  Everyone
> knows that multiplication takes precedence over addition.  “&&” is a
> multiplication.  “||” is, welll, almost an addition.  (Exor is addition in a
> mod 2 system.}  Anyone who can’t at least keep these two straight shouldn’t
> be doing programming.  Overall operator precedence is a little more
> complicated and I would recommend , for those who don’t have it all down,
> copying the page (two page spread) out of K&E or Stroustroup and taping it
> to the wall.  (I have done that in the past.) I just think this particular
> warning is carrying things to the extreme.  What next?  Warning: “*” inside
> of “+”?
>
> I don’t object to warnings.  “Assignment inside of “if”” is a good thing,
> because it is a common, easily committed, error, and I appreciate the
> warning.

"A warning on `==` inside of `if` is ridiculous. `==` is comparison for equality. `=` is assignment. Anyone who can't at least keep these two straight shouldn't be doing programming."

One programmer's appreciated warning is another programmer's annoying noise. If you think some warning is noise, turn it off. Please don't belittle those of us who are not perfect.


--
Greg Parker     email@hidden     Runtime Wrangler


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Unnecessary Boolean Warning
      • From: Jeffrey Walton <email@hidden>
References: 
 >Re: Unnecessary Boolean Warning (From: Gordon Apple <email@hidden>)

  • Prev by Date: Re: NSAttributedString -initWithPath RTFD crash on Lion
  • Next by Date: Re: Unnecessary Boolean Warning
  • Previous by thread: Re: Unnecessary Boolean Warning
  • Next by thread: Re: Unnecessary Boolean Warning
  • Index(es):
    • Date
    • Thread