Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!cmcl2!rna!cubsvax!peters From: peters@cubsvax.UUCP (Peter S. Shenkin) Newsgroups: net.lang.c Subject: Re: Expression sequencing query Message-ID: <559@cubsvax.UUCP> Date: Fri, 10-Oct-86 14:12:56 EDT Article-I.D.: cubsvax.559 Posted: Fri Oct 10 14:12:56 1986 Date-Received: Sat, 11-Oct-86 20:46:45 EDT References: <760@oakhill.UUCP> <111@titan.UUCP> <468@jc3b21.UUCP> <160@geac.UUCP> Reply-To: peters@cubsvax.UUCP (Peter S. Shenkin) Distribution: net Organization: Columbia Univ. Bio. CG Fac., NY Lines: 31 In article chris@umcp-cs.UUCP (Chris Torek) writes: > >If you want `a+b' to be done first, then `result + c', use > > result = a + b; > result += c; > >The solution is trivial, and the `problem' is well documented. > ...I never expect >parentheses to do more than override default precedence, so it is >not `totally counter-intuitive' to me. One of the attractions of C is its elegance and conciseness of expression; having to declare a variable only for the purpose of defining order of evaluation, even when the expression is extremely simple, is inelegant and inconcise, and the requirement to do so can easily double the size (as measured by the number of lines) of source code in numerical work where rounding error is significant and such order has to be thoroughly thought through. C wasn't originally designed for such applications, of course, but now that we're going to be able to do single-precision arithmetic across function calls there's going to be less and less reason to avoid using C; unfortunately, this parentheses thing is going to remain one of them. I understand the reason for the accepted convention, and I accept that reason, but even if it's necessary it's a necessary evil; let's not make a virtue out of it. I wish there were some way of forcing order of execution, to this extent anyway, within a line. Peter S. Shenkin Columbia Univ. Biology Dept., NY, NY 10027 {philabs,rna}!cubsvax!peters cubsvax!peters@columbia.ARPA