Design domain types to make illegal states unrepresentable. Use enums/variants (sum types) instead of strings or booleans when a value has a fixed set of meaningful states.
// ❌ WRONG: Any string is accepted, typos compile fine
struct Post {
status: String, // "draft", "published", "archived"... or "publsihed"?
}