|
|
|
|
|
by beders
165 days ago
|
|
Most of the musings on enforcing invalid states with ADTs are impractical when working with real data that needs runtime validation when it enters the system. Using a schema/spec/type library at runtime that is even more powerful than ADTs is a better investment - or to be less controversial - is an additional investment on top of types. Yes, it means the compiler can't help you as much, but who has time waiting for a compiler anyways ;) I find the "make illegal state unrepresentable via types" idea great for software that needs to fly a plane, but for enterprise software not so much. The cost/benefit is not justifiable. |
|