▲ 630 ▼ fixed rule (lemmy.blahaj.zone) submitted 2 years ago by ambrosiaforest@lemmy.blahaj.zone to c/196@lemmy.blahaj.zone 99 comments fedilink hide all child comments original: https://lemmy.blahaj.zone/post/8572031
[–] strepto@kbin.social 13 points 2 years ago (1 child) I quite like GNU permalink fedilink source hideshow 2 child comments replies: [–] p1mrx@sh.itjust.works 2 points 2 years ago* GNU style is logical, because braces are syntactically a single statement: while (x == y) func1(); // can be replaced by { ... } However, I prefer to entirely avoid unbraced single statements after while/if: while (x == y) { func1(); // easy to add func2(); later } Although this is ok when it fits: while (x == y) func1(); // brevity! permalink fedilink source parent
[–] p1mrx@sh.itjust.works 2 points 2 years ago* GNU style is logical, because braces are syntactically a single statement: while (x == y) func1(); // can be replaced by { ... } However, I prefer to entirely avoid unbraced single statements after while/if: while (x == y) { func1(); // easy to add func2(); later } Although this is ok when it fits: while (x == y) func1(); // brevity! permalink fedilink source parent