Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!ncrcom!cipc1!ncrlnk!ncrstp!npdiss1!mercer From: mercer@npdiss1.StPaul.NCR.COM (Dan Mercer) Newsgroups: comp.lang.c Subject: Re: When do you use "if ( a = b )"? (was Re: Funny mistake) Message-ID: <936@npdiss1.StPaul.NCR.COM> Date: 20 Mar 91 20:56:49 GMT References: <65837@eerie.acsu.Buffalo.EDU> <1991Mar18.195351.11985@unlv.edu> <357@ptcburp.ptcbu.oz.au> <1991Mar19.223605.24858@unhd.unh.edu> Reply-To: mercer@npdiss1.StPaul.NCR.COM (Dan Mercer) Organization: StPaul Lines: 32 In article <1991Mar19.223605.24858@unhd.unh.edu> al@unhd.unh.edu (Anthony Lapadula) writes: :In article <357@ptcburp.ptcbu.oz.au> michi@ptcburp.ptcbu.oz.au (Michael Henning) writes: :>grover@sonny-boy.cs.unlv.edu (Kevin Grover) writes: :> :>Simply say 1000 times: :> :> "I shalt never again use = instead of ==". : :The way I remember this is simple. I've made a mental note that "==" :is two characters long, as are "<=" and ">=". When I read code to myself, :these latter two come out as "less than or equal" and "greater than or :equal"; "==" comes out as "equal equal." : :Heck, maybe it only works for me. :-) : :-- Anthony (uunet!unhd!al, al@cs.unh.edu) Lapadula Works for me too. Actually, when I was just learning I went farther than that, to defining macros for == <> != (!= was actually the most difficult for me, because I programmed in several other languages where ^= was not equals. This causes some very starnge bugs in C). This was ugly, but got me through my first couple of projects. By then, I was so used to typing EQ for ==, that I made EQ an abbreviation for == in vi. Now vi handles the problem for me. -- Dan Mercer NCR Network Products Division - Network Integration Services Reply-To: mercer@npdiss1.StPaul.NCR.COM (Dan Mercer) "MAN - the ultimate one word oxymoron in the English Language"