Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 8/28/84; site lll-crg.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!umcp-cs!gymble!lll-crg!brooks From: brooks@lll-crg.ARPA (Eugene D. Brooks III) Newsgroups: net.lang.c Subject: Re: Re: Re: more questions about efficient C code Message-ID: <674@lll-crg.ARPA> Date: Tue, 2-Jul-85 00:34:36 EDT Article-I.D.: lll-crg.674 Posted: Tue Jul 2 00:34:36 1985 Date-Received: Thu, 4-Jul-85 00:13:22 EDT References: <474@crystal.UUCP> <397@umcp-cs.UUCP> <721@wlcrjs.UUCP>, <665@lll-crg.ARPA> <5746@utzoo.UUCP> Organization: Lawrence Livermore Labs, CRG group Lines: 31 > > ... Any experienced C programmer recognizes this code > > automatically and produces it without thinking. You have problems with > > it because you are not an experienced C programmer yet. > > Rubbish. "Any experienced programmer should be able to understand that" > really means "we know it's hard to read, but...". The idea is to make No!, it does not mean that. It means that the novice who has the complaint about not being able to understand things like if((fptr = fopen(filename, "r")) == NULL) { printf(stderr, ".....", .....); exit(1); } Does not yet clearly understand that in C the expression (a = b) has a value, which is whats on the RHS of the =, that can be conviently tested! The same goes for the novice who does not understand why lint complains that c is not used in foo() { int c; if((c = getchar()) != '\n') { SOME CODE } }