codeinabox@programming.dev to Programming@programming.devEnglish · 12 hours agoI keep tripping over “true, false, true”allthingssmitty.comexternal-linkmessage-square23fedilinkarrow-up147
arrow-up147external-linkI keep tripping over “true, false, true”allthingssmitty.comcodeinabox@programming.dev to Programming@programming.devEnglish · 12 hours agomessage-square23fedilink
minus-squareFizzyOrange@programming.devlinkfedilinkarrow-up7·6 hours agoRust doesn’t need this as much because it has enums so you can just do create_user(user, Role::Admin, Notify::None).
minus-squareEager Eagle@lemmy.worldlinkfedilinkEnglisharrow-up4·5 hours agoyou can have a better data structure in any language, but rarely someone will bother doing that for booleans
minus-squareTraister101@lemmy.todaylinkfedilinkarrow-up1·2 hours agoRight cause the boolean isn’t a named type. If you have two possible states that can be represented with a boolean, or an enum of the two possible states which embeds more info into the callsite
Rust doesn’t need this as much because it has enums so you can just do
create_user(user, Role::Admin, Notify::None).you can have a better data structure in any language, but rarely someone will bother doing that for booleans
Right cause the boolean isn’t a named type. If you have two possible states that can be represented with a boolean, or an enum of the two possible states which embeds more info into the callsite