Bit Fields and Flags
Pack booleans and small fields tightly.
Many Flags, One Byte
Settings are often just on-or-off switches. Packing them as bit fields stores many flags in a single tiny integer.
Booleans Take One Bit
Inside a packed struct, a bool occupies exactly one bit. Stack several together and they share a single byte.
const Mode = packed struct {
bold: bool,
italic: bool,
underline: bool,
};