Path: utzoo!mnetor!uunet!husc6!bbn!gatech!mcnc!rti!trt From: trt@rti.UUCP (Thomas Truscott) Newsgroups: comp.lang.c Subject: Re: == vs = Message-ID: <2006@rti.UUCP> Date: 3 Feb 88 16:08:32 GMT References: <11523@brl-adm.ARPA> <1202@eneevax.UUCP> <8836@ism780c.UUCP> Organization: Research Triangle Institute, RTP, NC Lines: 39 Summary: We cannot prevent errors, but cc and lint can detect many of them > My conclusion: if = had been chosen for the equality operator and any two > character symbol (e.g. ::) had been chosen for the assignment operator, the > cost of developing a program in C would be less even though the character > count in a program might be 0.5% greater. > Marv Rubinstein -- Interactive Systems The cost of developing a C program would be even less if the compiler (and of course lint) simply pointed out such possible mistakes. No matter what symbols are used for operators, programmers will occasionally use the wrong one. Compilers should warn of possible mistakes such as: if (x = y) foo(); /* :: would be just as dubious */ No matter how well-designed one's indenting style, programmers will occasionally make indenting mistakes. Compilers should warn of dubious indentations, such as: while (foo() > 0); bar(); No matter how clever the operator precedence, programmers will occasionally get unintended precedence. Compilers should warn of hazardous operator usage, such as: i = 1<