One more point regarding = and == (more flamage)

Dale Cook cdm at gem-hy.Inel.GOV
Fri Mar 29 08:39:20 AEST 1991


In article <1991Mar26.184245.3538 at chinet.chi.il.us>,
les at chinet.chi.il.us (Leslie Mikesell) writes:
|> In article <925 at isgtec.UUCP> robert at isgtec.UUCP writes:
|> >|>  a) while (*foo++ = *bar++)
|> >|>  b) while (*foo ++ == *bar++)
|> >|>  c) while ((*foo++ = *bar++) != 0)
|> 
|> >Well the biggest argument has been if you use a) the maintainer can't tell
|> >if you meant a) or b);  if you use c) the maintainer KNOWS you meant a).
|> >This isn't rubbish.
|> 
|> If you assume that the programmer didn't make a mistake (i.e. typed
|> what he was thinking), then a) is just as obvious as c).  If you
|> assume that he did make a mistake, then c) is probably more likely
|> to be wrong that a).  More characters = more chances to screw up.
                                         ^
                                         Don't you mean '==' ??

----------------------------------------------------------------------
--- Dale Cook          "You can sum this game up in one word -
    cdm at inel.gov        'you never know'".  --- J. Andujar
The opinions are mine.  The following disclaimer is my employers.
----------------------------------------------------------------------
========== long legal disclaimer follows, press n to skip ===========

Neither the United States Government or the Idaho National Engineering
Laboratory or any of their employees, makes any warranty, whatsoever,
implied, or assumes any legal liability or responsibility regarding any
information, disclosed, or represents that its use would not infringe
privately owned rights.  No specific reference constitutes or implies
endorsement, recommendation, or favoring by the United States
Government or the Idaho National Engineering Laboratory.  The views and
opinions expressed herein do not necessarily reflect those of the
United States Government or the Idaho National Engineering Laboratory,
and shall not be used for advertising or product endorsement purposes.



More information about the Comp.lang.c mailing list