Stamets@lemmy.world to Lemmy Shitpost@lemmy.world · 2 days agoThe Legends is among uslemmy.worldimagemessage-square62fedilinkarrow-up1596arrow-down113
arrow-up1583arrow-down1imageThe Legends is among uslemmy.worldStamets@lemmy.world to Lemmy Shitpost@lemmy.world · 2 days agomessage-square62fedilink
minus-squareI Cast Fist@programming.devlinkfedilinkarrow-up8·2 days ago// comment if(x < 10) { // comment1 if(x < 20) { // comment2 if(x < 30) { printf("hello, world\\n"); } } }
minus-squareJankatarch@lemmy.worldlinkfedilinkarrow-up10·2 days ago“Yeah x might be less than 10 but just in case check if it’s less than 30.”
minus-squareunderscores@lemmy.ziplinkfedilinkEnglisharrow-up4·edit-22 days agoThis is the cursed case when you case the forbidden scroll of the ancients: switch (true) { } edit: on second thought I’m not sure now I’ll have to think about how fall through cases work
// comment if(x < 10) { // comment1 if(x < 20) { // comment2 if(x < 30) { printf("hello, world\\n"); } } }
“Yeah x might be less than 10 but just in case check if it’s less than 30.”
This is the cursed case when you case the forbidden scroll of the ancients: switch (true) { }
edit: on second thought I’m not sure now I’ll have to think about how fall through cases work