Re:Chris Lattner on the Realm WWDC 2017 Swift Panel
by euyyn on Friday June 30, 2017 @07:07PM
(#14674102)
> Some languages lack of providing an appropriate aggregation alternative generally keeps inheritance alive.
I might not be understanding well, but are you talking of languages that happen to have no _composition_? But do have inheritance? Sounds like those with inheritance are a strict subset of those with composition (which in turn would be all but fringe languages).
Re:Chris Lattner on the Realm WWDC 2017 Swift Panel
by dyarosla on Friday June 30, 2017 @08:38PM
(#14674530)
No I'm talking about a lack of language constructs that make composition a pain and inheritance a quick fix: forwarding. Inheritance is often used improperly because writing forwarding methods to delegates is a pain. IS-A/HAS-A goes OUT-A the window: in many cases ushers developers to adopt it because it requires less typing.
Re:Chris Lattner on the Realm WWDC 2017 Swift Panel
by soulbadguy on Friday June 30, 2017 @07:21PM
(#14674161)
It seems to me that you are just explaining what the parent was saying. My point is not inheritance is good/bad or usefull, my point was that OOP doesn't imply inheritance it's just one of the many ways OOP languages reuse code.
There's a reason why composition is preferred over inheritance. There's also good reason why some programmers will take it to the extreme and say that it ALWAYS causes more problems. Some languages lack of providing an appropriate aggregation alternative generally keeps inheritance alive.
Some people will hold onto their positive notions about inheritance too, and that's fine, but there's a reason why many people advocate strongly against it (and why some modern language designers skip it altogether!)