Sujet : Re: Which code style do you prefer the most?
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 26. Feb 2025, 22:31:51
Autres entêtes
Organisation : None to speak of
Message-ID : <877c5cpf3s.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7
User-Agent : Gnus/5.13 (Gnus v5.13)
Janis Papanagnou <janis_papanagnou+
ng@hotmail.com> writes:
On 26.02.2025 12:53, Ar Rakin wrote:
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>
Re "goofy style"; I've seen someone preferring
>
while (q(a,b))
{
a=b;
f(x);
if (c>d)
{
g(y);
}
}
>
To each his own.
That looks like a nightmare for the code reviewers.
>
I cannot tell where that comes from; the person who uses it is an
experienced Perl programmer - may that be some convention in that
specific language context? (I can't tell.)
No, that's not a Perl convention. Most Perl code uses K&R-style brace
placement
while ($condition) {
do_something();
}
One interesting feature of Perl is that the braces are required.
[...]
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */