3 ms·
> I have always associated classes with inheritance. This is a common pattern I've noticed in discussions about OOP. There is a tendency to reduce it to "inher
by westoncb 7y ago
> I have always associated classes with inheritance.
This is a common pattern I've noticed in discussions about OOP. There is a tendency to reduce it to "inheritance," which turns the conversation into a straw man: "here is why inheritance is bad, therefore OOP is bad".
Same goes for identifying classes with inheritance. Their primary feature is grouping of methods and fields into (potentially) encapsulated units, and being a mechanism for abstraction: classes are more general than their instances and serve as a general pattern; upon construction they are 'configured' through parameters to their constructors and particular forms are arrived at.