Sujet : Re: how to make a macro work as a single line if stmt without braces
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.cDate : 28. Sep 2024, 13:02:05
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <86frpk3s1u.fsf@linuxsc.com>
References : 1 2 3
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
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?