Comments by "p11" (@porky1118) on "Ditch Your Favorite Programming Paradigm | Prime Reacts" video.
-
7:50 What I hate most about inheritance is being able to override things multiple times.
Something should either be abstract or maybe virtual with a default implementation, and you only override it once.
Else something like this could happen.
There's a class A. Class B inherits class A, since it's basically the same, but almost everything is slightly different.
Class C inherits from class B, since it's basically the same, but almost everything is slightly different.
Why not just let class C already inherit from class A and duplicate the one method from class B, which is still the same?
Or even better, turn this method into a function.
Maybe just create an abstract super class for A, B and C, all three of them, and only make the parts, which are not exactly the same abstract methods?
1