Corollary: "class hierarchies" become "class dynasties".https://twitter.com/propensive/status/1244903422643572736 …
Subtyping concerns a superset relationship on the set of provable properties of a type (e.g. method signatures), and inheritance concerns the sharing of the runtime implementations of none, some, most or all those properties, and is conferred (only, I thought...) by subclassing.
-
-
Here’s my current understanding: subtyping is telling you “A is a B”, inheritance “A has access to a known subset of B’s code”. I believe modules can inherit from one another and they’re not classes, the same argument goes for typeclasses.
-
There is, of course, clearly an ancestor / descendant relationship, but it needs not be semantic - subclassing mixes the two, at least in languages like scala and java, but it’s not a necessity. C++ has inheritance without subtyping, java subtyping without inheritance
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.