Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: Remembering C's operator precedence rules
Date: Mon, 18 Mar 2019 08:53:56 -0700
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <86d0mop4a3.fsf@mailhub.linuxsc.com>
References: <87lg1o9efx.fsf@bsb.me.uk> <1bh8cb93bi.fsf@pfeifferfamily.net> <86sgvqr96y.fsf@mailhub.linuxsc.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="a3f1224ae8cf58ee243636412ccb55a9"; logging-data="21081"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19M6yPDRRZI/KAxR0t4VF8lPMkre3h4gG8="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:vFDLYBYXTJBtaW5VxHLnoMAo9n0= sha1:IOlCuCqIbagc8vhqr8Dpnduc+nw=
Xref: csiph.com comp.lang.c:142037
Bart writes:
> On 13/03/2019 17:11, Tim Rentsch wrote:
>
>> Joe Pfeiffer writes:
>>
>>> By the time you've got 15 levels for 49 operators, any sane
>>> programmer will be putting in some extra parentheses here and
>>> there
>>
>> Sure, if there is no particular structure to the levels and
>> which operators go where. In C there is quite a bit of
>> structure (and at the risk of repeating myself, there are
>> better ways to indicate grouping than using parentheses).
>>
>>> [...], and if I don't remember for sure in my own code
>>
>> It isn't hard to remember if one makes an effort to learn.
>> Fifteen to thiry minutes, tops, and that's a one-time cost.
>>
>>> it probably isn't fair to expect someone coming along later
>>> (possibly even me under a full moon) to have the same intuition.
>>
>> This is a circular pattern. We expect people won't remember, and
>> because they aren't expected to learn and remember they don't learn
>> and remember, and since they don't we have low expectations...
>> and the cycle continues. We should reverse the direction of the
>> cycle.
>
> People want to write code so that it is clear to everyone
> else. Including those more used to other languages which have
> different precedences. [...]
Yes, some people have all sorts of idiotic ideas. They are
welcome to think what they like, as long as they don't try
to force their ideas on people who don't want them.