Re: C question for you old guys ;-)
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.