Re: = and ==
Re: = and ==
- Subject: Re: = and ==
- From: Steve Bird <email@hidden>
- Date: Tue, 25 May 2004 15:57:21 -0400
On May 25, 2004, at 2:24 PM, Markian Hlynka wrote:
this is easily avoided in the case of comparison to constants etc.
instead of
int foo;
if (foo=0) //bug
make a point of
if (0=foo) //compiler error.
Of course, this doesn't work if you're comparing variables. :-(
Round and round and round we go, I guess it's my turn again...
If I cannot remember to use "==" instead of "=", then how am I going to
remember to put the arguments in backwards?
When I count my change at the checkout station, I don't think
if ($0.47 == changeSheGaveMe)
Say "Thank you";
else
Complain();
I think:
if (changeSheGaveMe == $0.47)
Say "Thank you";
else
Complain();
I am going to quit reading these threads...
I am going to quit reading these threads...
I am going to quit reading these threads...
----------------------------------------------------------------
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175
_______________________________________________
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.
References: | |
| >= and == (From: Markian Hlynka <email@hidden>) |