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

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.


  • Follow-Ups:
    • Re: = and ==
      • From: Sherm Pendley <email@hidden>
    • Re: = and ==
      • From: Ondra Cada <email@hidden>
References: 
 >= and == (From: Markian Hlynka <email@hidden>)

  • Prev by Date: Re: Copy/Paste not working from keyboard
  • Next by Date: Action on NSButtonCell in NSTableView
  • Previous by thread: = and ==
  • Next by thread: Re: = and ==
  • Index(es):
    • Date
    • Thread