Coding for 20 years | Working for startups for 10 years | Team leader and mentor | More information about me: https://thevaluable.dev/page/about/
Twitter: @Cneude_Matthieu
Abstraction is not only for OOP. You can abstract away details nobody cares in most programming languages. My take: thevaluable.dev/abstraction-type-s...
Inheritance as you describe it should be rarely used, and especially not to share code as you do in your example. Otherwise, it will be difficult to modify one of your children without modifying the parent... it makes everything tightly coupled, which is often not what you want. I've written about that here: thevaluable.dev/guide-inheritance-...
It's safer to use interface constructs to achieve polymorphism. Again, using inheritance here makes everything highly coupled.
Many functional languages implement different ways to achieve polymorphism too...
Some advice (only my opinion, of course):
Thanks for the knowledge man.