alphacyberranger@lemmy.world to Programmer Humor@programming.devEnglish · 1 year agoMore the merrierlemmy.worldimagemessage-square76fedilinkarrow-up11.25Karrow-down114
arrow-up11.23Karrow-down1imageMore the merrierlemmy.worldalphacyberranger@lemmy.world to Programmer Humor@programming.devEnglish · 1 year agomessage-square76fedilink
minus-squarespader312@lemmy.worldlinkfedilinkarrow-up10·1 year agoA form of “self documentation” I like to do is create variables for conditions before using it in an if statement. If you break down a funky conditional into easy to read variables it becomes a lot more clear what it’s trying to do. Idk how to write code on sync: const isHumid = xxxx; const isHot = yyyy; const isSunny = zzzzz; If (isHot && isHumid && isSunny) { ... }
A form of “self documentation” I like to do is create variables for conditions before using it in an if statement. If you break down a funky conditional into easy to read variables it becomes a lot more clear what it’s trying to do.
Idk how to write code on sync:
const isHumid = xxxx; const isHot = yyyy; const isSunny = zzzzz; If (isHot && isHumid && isSunny) { ... }