kyub@discuss.tchncs.de to Programmer Humor@programming.devEnglish · edit-23 个月前The infamous "if loop" actually existsdiscuss.tchncs.deexternal-linkmessage-square30fedilinkarrow-up1197arrow-down113file-text
arrow-up1184arrow-down1external-linkThe infamous "if loop" actually existsdiscuss.tchncs.dekyub@discuss.tchncs.de to Programmer Humor@programming.devEnglish · edit-23 个月前message-square30fedilinkfile-text
minus-squarebrian@programming.devlinkfedilinkarrow-up8·3 个月前found the following in our codebase the other day. while(booleanFlag) return; thhere wasn’t more in the loop body, that was it. the loop conditional does exist and it can hurt you.
minus-squareRikudou_Sage@lemmings.worldlinkfedilinkarrow-up4·3 个月前Can it hurt you, though? My guess would be every sane compiler and interpreter optimizes this.
minus-squarebrian@programming.devlinkfedilinkarrow-up3·3 个月前the codebase readability certainly suffers, and this isn’t the only case of shenanigans like this
found the following in our codebase the other day.
while(booleanFlag) return;
thhere wasn’t more in the loop body, that was it. the loop conditional does exist and it can hurt you.
Can it hurt you, though? My guess would be every sane compiler and interpreter optimizes this.
the codebase readability certainly suffers, and this isn’t the only case of shenanigans like this