The thing about inheritance is that you have to be careful when you design the hierarchy of your classes. It might solve an immediate problem that you have but later down the road they can become an obstacle to implement a new feature. I've heard people say that you should only use inheritance when you are absolutely sure you only need a Parent and Child class, that is a hierarchy with just one level.
When you use composition techniques it should be easier to just add new code without worrying about old code.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The thing about inheritance is that you have to be careful when you design the hierarchy of your classes. It might solve an immediate problem that you have but later down the road they can become an obstacle to implement a new feature. I've heard people say that you should only use inheritance when you are absolutely sure you only need a
Parent
andChild
class, that is a hierarchy with just one level.When you use composition techniques it should be easier to just add new code without worrying about old code.