• 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 question for you old guys ;-)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C question for you old guys ;-)


  • Subject: Re: C question for you old guys ;-)
  • From: Jay Prince <email@hidden>
  • Date: Wed, 11 Jun 2003 13:53:06 -0700

On Wednesday, June 11, 2003, at 11:06 AM, Simon Stapleton wrote:
No, it doesn't improve readability. Having come across this particular atrocity a few times in my career, I can say that _every_ time I've seen it, it's taken longer to read the code.


Maybe I missed it, but why do people not just put the constant on the left-hand side of the comparison?

if (1 = foo) won't compile. Typing = instead of == is a bug I've only committed once, that I can recall... but I started putting the constant on the left just in case anyway.

Since the error was rare for me, it hasn't really sped up debugging time, but it does give me more confidence in my conditionals.

And its pretty non-offensive, I would think.

Jay
_______________________________________________
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 question for you old guys ;-)
      • From: Steve Bird <email@hidden>
    • Re: C question for you old guys ;-)
      • From: Greg Weston <email@hidden>
    • Re: C question for you old guys ;-)
      • From: Karl Goiser <email@hidden>
References: 
 >Re: C question for you old guys ;-) (From: Simon Stapleton <email@hidden>)

  • Prev by Date: Re: Errrrm, that breaks <ctype> you know (Re: C question for you old guys ;-))
  • Next by Date: FW: Dragging Rect
  • Previous by thread: Re: C question for you old guys ;-)
  • Next by thread: Re: C question for you old guys ;-)
  • Index(es):
    • Date
    • Thread