Re: C question for you old guys ;-)
Re: C question for you old guys ;-)
- Subject: Re: C question for you old guys ;-)
- From: Karl Goiser <email@hidden>
- Date: Thu, 12 Jun 2003 09:27:45 +1000
This is very interesting!
To me, asking if 1 == foo is really counter intuitive and just looks
weird. So, I tried to think of some natural language examples of why
it might be so. Here's an example of putting the constant last:
The colour of the sky is blue
but you will note that:
Blue is the colour of the sky
doesn't sound wrong - to me anyway, or am I just screwy?
Anyway, the solution to this debate, as previously mentioned, is for us
all to make sure that we have 'warnings' turned on -Wall (which is easy
to remember!) - and heed them!
Karl
On Thursday, June 12, 2003, at 06:53 AM, Jay Prince wrote:
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.