amber (she/her)@lemmy.blahaj.zone to 196@lemmy.blahaj.zone · 7 months agofixed rulelemmy.blahaj.zoneimagemessage-square93fedilinkarrow-up1152arrow-down10file-text
arrow-up1152arrow-down1imagefixed rulelemmy.blahaj.zoneamber (she/her)@lemmy.blahaj.zone to 196@lemmy.blahaj.zone · 7 months agomessage-square93fedilinkfile-text
minus-squarep1mrx@sh.itjust.workslinkfedilinkarrow-up1·edit-27 months agoGNU 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!
I quite like GNU
GNU style is logical, because braces are syntactically a single statement:
However, I prefer to entirely avoid unbraced single statements after while/if:
Although this is ok when it fits: