Sujet : Re: Which code style do you prefer the most?
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 04. Mar 2025, 19:14:43
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250304101022.154@kylheku.com>
References : 1 2 3 4
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2025-03-04, bart <
bc@freeuk.com> wrote:
The style I use for generated code is like this:
>
if (cond) {
stmt1;
}
else {
stmt2;
}
I've been known to do this:
if (case_ineligible_for_switch) {
// ...
} else switch (state_variable) {
// ...
}
or
if (case_not_requiring_loop) {
// ...
} else for (;;) {
// ...
}
and I might even have historically perpetrated something like:
if (case_not_requiring_loop) {
// ...
} else if (case_requiring_loop) for (;;) {
// ...
} else {
// ...
}
:)
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca