3 ms·
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 ar
by weberc2 7y ago
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.
- tonyedgecombe 7y agoIt'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.
- weberc2 7y agoYeah, I meant it as a learning suggestion, not a “switch your main language” suggestion. Fully agree with you.