2 ms·
> Obviously, composition over inheritance strives a bit against one of the original key concepts of OOP - which is inheritance. I don't understand why people k
by AllegedAlec 7y ago
> Obviously, composition over inheritance strives a bit against one of the original key concepts of OOP - which is inheritance.
I don't understand why people keep pushing this idea of OOP as requiring classes and inheritance, when it very much does not.
Also, it's really easy to say that FP is better than OOP, or the other way around, when people keep comparing their favourite with a straw-manned version of the other.
- almostdeadguy 7y agoI assume you're referring to the definition of OOP coming from the Alan Kay quote: “OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things." This definition includes nearly every language with modules, polymorphism, and depending what counts as message passing might either dis-include statically typed languages, languages without a defined model of concurrency that disallows shared mutable state, or languages without message passing library support. If that's what canonically counts as OOP, there's no straw-manning going on here, the discussion is just a comparison against a pretty well-defined category of programming languages with different features that are often described as and understood to be object-oriented. Whenever people bring this up I often hear that Erlang is supposed to be the canonical object-oriented language, and if that's the case, I'm not sure how we could call this discussion straw-manning, because it's just talking about totally different languages.