Antimemes rule

moosetwin@lemmy.dbzer0.com to 196@lemmy.blahaj.zone – 224 points –
35

You are viewing a single comment

Allman if the condition is very long

while(isSomething
    && isSomethingElse
    && nFoo < 10)
{
    bla();
    bla();
}

vs

while(isSomething
    && isSomethingElse
    && nFoo < 10) {
    bla();
    bla();
}

Hmm, I think the condition gets newlined and you K&R on the closing parenthesis IMO:

while (
    isSomething 
    && isSomethingElse
    && nFoo < 10
) {
    blah();
    blah();
}

You could also keep isSomething on the first line too, but I think it's nice to keep the whole multiline condition at the same indent width

1 more...