• 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: C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C


  • Subject: Re: C
  • From: cricket <email@hidden>
  • Date: Sat, 30 Aug 2003 16:20:34 -0700

I find it really nice when I'm both reading and writing code to use parentheses liberally for this reason: many editors (like PB) let you click on one open paren and see the corresponding close paren. This makes it FAR easier to grok complicated expressions.

I think forgetting the precedence rules and always using parentheses to make thing absolutely clear is not necessarily a bad idea, as long as you're aware they exist and know how to look them up if you need them when reading other people's code.

- cricket

On Aug 30, 2003, at 4:03 PM, Clark Cox wrote:

I never bother to remember precedence rules. I just make sure I put parentheses in anyway (like the above for example) to ensure the right result, regardless of precedence.

That's very bad advice. It's best to actually know what's going on, than to use parentheses "just in case". There are so many references from which you can get this information (a google search for "C operator precedence" turned up 218,000 results); not knowing it is inexcusable. It would be as if, in a middle school algebra class, a student said "I don't need to know that multiplication has a higher precedence that addition, I'll just put parentheses in anyway".

----->
Software Entomologist  Mail for Mac OS X
http://www.apple.com/macosx/panther/mail.html
---------->
Stonehenge: One of the biggest henges in the world.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: C
      • From: Clark Cox <email@hidden>
References: 
 >Re: C (From: David Thorp <email@hidden>)
 >Re: C (From: Clark Cox <email@hidden>)

  • Prev by Date: Re: C again
  • Next by Date: Re: C
  • Previous by thread: Re: C
  • Next by thread: Re: C
  • Index(es):
    • Date
    • Thread