@jasongorman For me, it’s just like what you said about how tests force you to think carefully about behavior before you write the code. In the case of writing expressive model types, you’re forced to think carefully about the concepts/entities you’re trying to represent.
@jasongorman For me, getting the model types right makes it easier to think through the behavior properly.
The simplest example is nullability. If your type system can express that and enforce null handling, then that forces you to think about stuff like “how should this operation behave when property A is null”?
I’d say sum types (e.g. sealed classes) where the compiler can check that you’ve exhaustively handled all scenarios is the next level of that beyond nullability.