moosetwin@lemmy.dbzer0.com to 196@lemmy.blahaj.zoneEnglish · edit-29 months agoAntimemes rulelemmy.dbzer0.comimagemessage-square35fedilinkarrow-up1224arrow-down11cross-posted to: antimeme@lemmy.world
arrow-up1223arrow-down1imageAntimemes rulelemmy.dbzer0.commoosetwin@lemmy.dbzer0.com to 196@lemmy.blahaj.zoneEnglish · edit-29 months agomessage-square35fedilinkcross-posted to: antimeme@lemmy.world
minus-squarebort@feddit.delinkfedilinkarrow-up28·edit-29 months agoAllman if the condition is very long while(isSomething && isSomethingElse && nFoo < 10) { bla(); bla(); } vs while(isSomething && isSomethingElse && nFoo < 10) { bla(); bla(); }
minus-square9point6@lemmy.worldlinkfedilinkarrow-up53·9 months agoHmm, 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
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 widthThis is the way.
deleted by creator