kyub@discuss.tchncs.de to Programmer Humor@programming.devEnglish · edit-21 year agoThe infamous "if loop" actually existsdiscuss.tchncs.deexternal-linkmessage-square30linkfedilinkarrow-up1197arrow-down113file-text
arrow-up1184arrow-down1external-linkThe infamous "if loop" actually existsdiscuss.tchncs.dekyub@discuss.tchncs.de to Programmer Humor@programming.devEnglish · edit-21 year agomessage-square30linkfedilinkfile-text
minus-squarebrian@programming.devlinkfedilinkarrow-up8·1 year agofound 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·1 year agoCan it hurt you, though? My guess would be every sane compiler and interpreter optimizes this.
minus-squarebrian@programming.devlinkfedilinkarrow-up3·1 year agothe 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