3 ms·
I know Haskell. We don't even need to address replacing exceptions with monads to show how and why OOP and patterns are in many many cases a bad solution.
by crimsonalucard 9y ago
I know Haskell. We don't even need to address replacing exceptions with monads to show how and why OOP and patterns are in many many cases a bad solution.
- smadge 9y agoThe 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.