63
I keep tripping over “true, false, true”
(allthingssmitty.com)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
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
Yeah I do wonder if we need an easier way to declare these things because programmers are lazy and even in Rust I wouldn't always bother.
You can kind of do it in Typescript with strings:
But of course the downside is they are strings at runtime. I'm sure it's possible though.