Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!prls!pyramid!amiga!cbmvax!daveh From: daveh@cbmvax.cbm.UUCP (Dave Haynie) Newsgroups: net.lang.c Subject: Re: Re: Precedent for use of = Message-ID: <445@cbmvax.cbmvax.cbm.UUCP> Date: Tue, 24-Jun-86 13:22:09 EDT Article-I.D.: cbmvax.445 Posted: Tue Jun 24 13:22:09 1986 Date-Received: Fri, 27-Jun-86 04:41:26 EDT References: <2110@umcp-cs.UUCP> Organization: Commodore Technology, West Chester, PA Lines: 46 > Here is where you will, with some, `run into a brick wall' (as they > never did say in Bree). Some will claim that it *is* broken, > because people do at times write > > if (var = expr) ... > > when they in fact meant > > if (var == expr) ... > > As for myself, I believe that anyone can do bad things in any > language (includin' English like I's a-doin' right here now right > before your very own eyes doncha know :-) ), and that the proper > measure of a language is not how difficult it makes writing bad > code, but rather how easy it makes writing good code. > -- I could just as easily write in PASCAL, M2, or ADA IF var := expr THEN ... when I mean IF var = expr THEN ... Of course the compiler will flag me about this, but what I get for that compiler error message is the loss of my assignment OPERATOR, replaced by a special case of assignment, the assignment STATEMENT. Certainly there may be less chance of error with the PASCAL style arrangement, at least for beginners. But I KNOW C, and even at 4:00 AM I don't think I've made the assignment/comparison transposition error for a few years. But I use assignment as an operator ALL THE TIME. The PASCAL syntax is like much about PASCAL versus C; PASCAL forces you into a limited means of expression in return for catching your errors for you. This is like giving a dull scalpel to a surgeon; he can't cut himself with it. > In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1516) > UUCP: seismo!umcp-cs!chris > CSNet: chris@umcp-cs ARPA: chris@mimsy.umd.edu -- /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ Dave Haynie {caip,ihnp4,allegra,seismo}!cbmvax!daveh A quote usually goes here, but its currently being rennovated. These opinions are my own, though for a small fee they be yours too. \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/