5 ms·
The point has nothing to do with functional vs oop, or exceptions versus monads. It has to do with using the features of your language of choices type system to
by smadge 9y ago
The point has nothing to do with functional vs oop, or exceptions versus monads. It has to do with using the features of your language of choices type system to prevent bugs. The thing going on here is putting validation logic in your type constructors so it's impossible to construct an invalid type without triggering a runtime "exception" or error.
- crimsonalucard 9y agoOk I get your point. You can still have a function take in an address object rather than inserting into another object with a constructor. You are correct in that building types leads to a more safe program but I was more addressing the flaw with objects rather then types.