Remix.run Logo
Smaug123 4 days ago

My preferred framing of this is: "You told me a condition was `true`, presumably because you had evidence for it. Why are you telling me you once had evidence? Just give me the evidence!".

Don't tell me that an event happened; give me the event that happened. (Sure, project it down to something if you like for efficiency; throwing away most of the information is what gives the timestamps example.)

Don't tell me simply whether a user is an admin; tell me what the user is. (That's the enums example.)

Logically speaking, `bool` is equivalent to `Optional<unit>`, and in fact that's frequently what it's used for. Phrased that way, it's much more obvious that this representation doesn't match all that many domains very well; it's clearly useful for performance (because throwing away unnecessary data is a standard performance technique), but it's also clearly a candidate premature optimisation.