
Don’t Use Booleans - luuio
https://www.luu.io/posts/dont-use-booleans/
======
nwah1
Surprisingly sensible. I wonder if compiler magic could, in theory, reduce
enums that have only two options down to a single bit, but still provide all
the type safety guarantees. Or maybe provide another primitive just for that
purpose.

Particularly with a new primitive, you could literally have a language that
just doesn't allow you to define generic booleans.

~~~
luuio
At the bare metal layer, most booleans are actually transported around as
`int` (or WORD size), so there's no real performance benefit to compressing
things down to one bit, other than if you really need to save 7 bits in
physical storage.

