Path: csiph.com!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: How About Disallowing Assignments In Expressions?
Date: Thu, 15 Feb 2024 06:14:57 -0800
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <86o7chzue6.fsf@linuxsc.com>
References: <87r0hlef8q.fsf@nosuchdomain.example.com> <87sf20o4e2.fsf@bsb.me.uk> <8734tzoli4.fsf@bsb.me.uk> <87v86vbx6s.fsf@nosuchdomain.example.com> <87il2vbvza.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="d6a0776853173adee93a90f6ecdad10b"; logging-data="3514852"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++V5AsPAzykBPA3kecKVWRdlqsv8CdJ+E="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:qaRskQpXmJyQa2Xu4AKzbuZHIT8= sha1:PyMS6PNDXuMq6CItO7p4eJw81sg=
Xref: csiph.com comp.lang.c:382537
Janis Papanagnou writes:
> On 12.02.2024 02:17, Lawrence D'Oliveiro wrote:
>
>> You seem to be saying that something like
>>
>> bool a = b == c;
>>
>> should not be allowed.
>
> I have the habit to write such specific expressions with parenthesis
>
> a = (b == c);
>
> for own convenience or better maintainability. (Just BTW.)
My practice is to avoid redundant parentheses. If it's important
to emphasize the precedence relationships, in most cases I would
do that something like this:
a = b == c;
I find using spacing in such cases to be a better impedance match
to human eye hardware than using redundant parentheses.