Re:Golang concepts from an OOP point of view
by catnaroek on Wednesday September 14, 2016 @06:50PM
(#12501878)
> It doesn't really matter. Your suggestion is worthless in practice with Go since "your subtype" doesn't enable polymorphism.
I never said that struct embedding creates a subtype. I said that it can be used to emulate inheritance (subclassing). Inheritance and subtyping are very different things, and the fact languages like Java and C++ conflate them actually creates several problems. See:
I never said that struct embedding creates a subtype. I said that it can be used to emulate inheritance (subclassing). Inheritance and subtyping are very different things, and the fact languages like Java and C++ conflate them actually creates several problems. See:
[0] http://www.cs.utexas.edu/~wcook/papers/InheritanceSubtyping9...
[1] http://stackoverflow.com/a/23592298/46571