Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!caip!clyde!cbatt!cbosgd!ihnp4!inuxc!pur-ee!uiucdcs!okstate.UUCP!uokvax.UUCP!emjej From: emjej@uokvax.UUCP.UUCP Newsgroups: net.lang.c Subject: Re: PRECEDENT FOR USE OF = Message-ID: <3000080@uokvax.UUCP> Date: Thu, 10-Jul-86 10:08:00 EDT Article-I.D.: uokvax.3000080 Posted: Thu Jul 10 10:08:00 1986 Date-Received: Sat, 12-Jul-86 22:40:15 EDT References: <1645@brl-smoke.ARPA> Lines: 26 Nf-ID: #R:brl-smoke.ARPA:1645:uokvax.UUCP:3000080:000:1294 Nf-From: uokvax.UUCP!emjej Jul 10 09:08:00 1986 /* Written 8:15 pm Jul 3, 1986 by MEYER@RADC-TOPS20.ARPA in net.lang.c */ I know this is going to cause a bit more of a stir here, here goes. Everybody keeps guessing at the reasons for the use of = for asignment and == for equality tests. How about a different angle: how many times in a program do you assign something versus how many times you compare things? /* End of text from net.lang.c */ If that's a reasonable principle of programming language design, then let's see if we can't get Huffman-coding for C keywords in the next ANSI draft standard. = for assignment is one of many flaws in C syntax. Combined with the absence of a Boolean type, it is a considerable source of errors in C code. Lint should warn the user of every occurrence of "if (a = b)". (I predict that at least one C-worshipper will say "*real* C programmers, as opposed to quiche-eaters, don't make that mistake." I think they're wrong, based on the instances of it I've seen. Second-order comment will be "you haven't done a study, so you're not worth bothering with": I admit that I haven't, but (1) I lack the resources, and (2) it's too bad the designers of programming languages (and Unix utilities) don't have to do human factors studies before introducing their products.) James Jones