> Some people say that they think something is wrong with object-oriented programming, but can any alternative that is so hard to explain be better?
Personally, I think that OOP has the opposite program. Abstractions such as classes, encapsulation, polymorphism etc. are to some extent easier to explain than abstractions such as monads, at least coming from an imperative background. But on the other hand, they’re much more difficult to apply correctly. I know I was greatly confused by how to use these OOP concepts until I looked into Smalltalk, which was the first time I had actually seen these concepts used effectively. By contrast, once you understand them, it is basically impossible to apply monads ‘incorrectly’. (I’m not even sure what that would mean.)
I suppose you could counter that this is just because OOP concepts are often explained poorly. But I’m not convinced that OOP concepts are any less difficult than monads to explain well. At most, I suspect it is easier to give someone the illusion of understanding OOP.
Personally, I think that OOP has the opposite program. Abstractions such as classes, encapsulation, polymorphism etc. are to some extent easier to explain than abstractions such as monads, at least coming from an imperative background. But on the other hand, they’re much more difficult to apply correctly. I know I was greatly confused by how to use these OOP concepts until I looked into Smalltalk, which was the first time I had actually seen these concepts used effectively. By contrast, once you understand them, it is basically impossible to apply monads ‘incorrectly’. (I’m not even sure what that would mean.)
I suppose you could counter that this is just because OOP concepts are often explained poorly. But I’m not convinced that OOP concepts are any less difficult than monads to explain well. At most, I suspect it is easier to give someone the illusion of understanding OOP.