News for hackers. Stuff that matters.
Re:Inheritance versus Composition by weberc2 on Thursday May 09, 2019 @01:26AM (#19865637)
Use composition for reuse and interfaces for polymorphism. These can do the same as inheritance and more, and they do it more cleanly. Reuse and polymorphism are orthogonal concerns that inheritance tries to fuse awkwardly together.

Try Go if you’d like a familiar language without the inheritance that you can pick up in an afternoon.

Re:Inheritance versus Composition by tonyedgecombe on Thursday May 09, 2019 @05:19AM (#19866618)
It's not compulsory even in a language that supports it, I'm working on a medium sized C# project that has minimal use of inheritance and only then to fit in with the requirements of a library feature.
Re:Inheritance versus Composition by weberc2 on Thursday May 09, 2019 @08:59AM (#19867850)
Yeah, I meant it as a learning suggestion, not a “switch your main language” suggestion. Fully agree with you.