2 ms·
> If you need a new invariant, you make a new type. Agreed, but is that OO? From [2]: > Class invariants are established during construction and constantly m
by mrkeen 6y ago
> If you need a new invariant, you make a new type.
Agreed, but is that OO?
From [2]:
> Class invariants are established during construction and constantly maintained between calls to public methods. Code within functions may break invariants as long as the invariants are restored before a public function ends.
That just sounds like a race condition with extra steps.
- wrsh07 6y agoI think you can use OO effectively to define invariants. (You could also do this with FP!) Beyond that, I'm not sure I understand your question.