@[email protected] to Programmer [email protected]English • edit-22 months agoThe infamous "if loop" actually existsdiscuss.tchncs.deimagemessage-square29fedilinkarrow-up1189arrow-down112file-text
arrow-up1177arrow-down1imageThe infamous "if loop" actually existsdiscuss.tchncs.de@[email protected] to Programmer [email protected]English • edit-22 months agomessage-square29fedilinkfile-text
minus-square@[email protected]linkfedilink7•2 months 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_Sagelinkfedilink4•2 months agoCan it hurt you, though? My guess would be every sane compiler and interpreter optimizes this.
minus-square@[email protected]linkfedilink3•2 months 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