Liste des Groupes | Revenir à cl c |
On 04/03/2025 18:14, Kaz Kylheku wrote:
>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 {
// ...
}
I like the brace on its own line. It visually separates the
condidition from the statement.
How do people format long and complex conditions, given that
you're trying not to a much over 80 columns?
Les messages affichés proviennent d'usenet.