News for hackers. Stuff that matters.
Re:Ask HN: How often do you use inheritance? by probinso on Sunday May 14, 2017 @11:34PM (#14338973)
Inheritance is a great way to allow your newly defined class to interface with the language syntax or system environment features in a useful way. Doing something like inheriting from a dictionary in Python allows for you to extend a very versatile tool that already exists, that has been optimized for use in the language.

If you are going to bother inheriting from a class, then you should weigh the cost of your code complexity against it. It is definitely worth it sometimes

If you wrote both the class and sub-class, then you're likely over engineering the problem (unless you have a sufficiently large program you're working on)

There are no comments on this comment yet.