Comment by mrkeen
4 days ago
But OOP needs something to distinguish it from the rest, otherwise it's just P.
Do people honestly think other languages don't do whatever definition OOP has today? Encapsulation & polymorphism? Message-passing & late-binding?
Inheritance is the one thing that the other languages took a look at and said 'nope' to.
(Also, the OOP texts say to prefer composition anyway)
If they use protocols with defaults (traits, interfaces, etc.), then they have inheritance.
What they don’t get with protocols, though, is polymorphism. I think a lot of folks confuse them.
I wrote about an odd bug that I encountered, from protocol defaults: https://littlegreenviper.com/the-curious-case-of-the-protoco...
IME with this sort of thread there is a huge correlation between praising OOP and believing that encapsulation is an identifying feature of OOP. Also polymorphism to a much lesser extent, but the other two almost none.
It is very difficult to tell whether this is a definitional problem - people believe any kind of encapsulation is OOP - or if some people can't wrap their heads around how to do encapsulation without message passing and the rest.