| Deutsch English Français Italiano |
|
<86v7yf2h8t.fsf@linuxsc.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups: comp.lang.c
Subject: Re: how to make a macro work as a single line if stmt without braces
Date: Sat, 28 Sep 2024 21:53:06 -0700
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <86v7yf2h8t.fsf@linuxsc.com>
References: <PaWdnZ3R-9zI6nP7nZ2dnZfqn_GdnZ2d@brightview.co.uk> <vcm16e$1hm2u$1@dont-email.me> <vcn6m8$1n1vu$1@dont-email.me> <86frpk3s1u.fsf@linuxsc.com> <20240928203048.00006703@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Sun, 29 Sep 2024 06:53:06 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="af077a0b22884ed040881afe1a29036e";
logging-data="1715371"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/JNem+Cjfp9BGhrXGoKYCgwF6OxMyBln0="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:jVjXL4khF/NWIPdZzjCGE9elUDg=
sha1:OqGQ5HtxiOZDHsUqxz9mZq6rvME=
Bytes: 2309
Michael S <already5chosen@yahoo.com> writes:
> On Sat, 28 Sep 2024 05:02:05 -0700
> Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:
>
>> Andrey Tarasevich <andreytarasevich@hotmail.com> writes:
>>
>> [...]
>>
>>> And don't use "Egyptian" braces [the style used in the
>>> first edition of The C Programming Language, by Kernighan
>>> and Ritchie].
>>>
>>> This is the proper formatting style with braces
>>>
>>> if (failed)
>>> {
>>> ...
>>> }
>>> else
>>> {
>>> ...
>>> }
>>>
>>> The vertical spacing introduced by the `{` line provides
>>> separation between condition and the branch, which makes
>>> your code much more readable. [...]
>>
>> What qualities does this layout style have that make it "more
>> readable", other than it being one that you like or prefer?
>
> { at the same level of indentation as its matching }
Certainly it is true that the layout style shown has the open
brace at the same level of indentation as the matching close
brace. What about that property makes this layout "more
readable"? The statement given sounds like a tautology -
I don't see that any new information has been added.