= vs. ==

Sean Selitrennikoff selitr at jackal.cs.wisc.edu
Thu Sep 20 02:33:54 AEST 1990


Look, it really is a matter of semantics.  The problem arises in that
most of the complainers out there started in PASCAL where 

if (a = b) 

is a test.  Then we switched to C and it became a pain in the parse.  In
any case, if we had never learned PASCAL (or other language with '=' as
a test) then we wouldn't be having this convo.

Personally I think every C compiler ought to have a switch -DUM_DUM that
checks for idiot errors and pops out a warning for them.  That would solve
all these errors that we make that are typo's.

e.g.

  for (i=0;i<10;i++);
    printf("%d",i);


I hate it when the loop does nothing.  We're so used to putting ';' at
the end of every line.  I musta wasted days on things like this.  In
any case, it's all a part of the hacking experience.  What would life
be if you couldn't spend days looking for a bug only to have some dweeb
peer over your shoulder and find it immediately?  You oughta try teaching
PASCAL 6 times a week and then trying to write a compiler in C.  That'll
make you smile/grunt/groan several times a week.

Bottom Line:  Let it be.  That's the way it is, all we can do is build
our own 'lint' that catches our idiot errors.


- a minor opinion from someonw with a minor mind.

sean



More information about the Comp.lang.c mailing list