When do you use "if ( a = b )"? (was Re: Funny mistake)

Dan Mercer mercer at npdiss1.StPaul.NCR.COM
Thu Mar 21 06:56:49 AEST 1991


In article <1991Mar19.223605.24858 at unhd.unh.edu> al at unhd.unh.edu (Anthony Lapadula) writes:
:In article <357 at ptcburp.ptcbu.oz.au> michi at ptcburp.ptcbu.oz.au (Michael Henning) writes:
:>grover at 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 at 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 at npdiss1.StPaul.NCR.COM (Dan Mercer)
"MAN - the ultimate one word oxymoron in the English Language"



More information about the Comp.lang.c mailing list