2 ms·
> Here, I think maybe we're too far the other direction. We have at least three examples of this being an actual problem in practice that could not be worked a
by pcwalton 12y ago
> Here, I think maybe we're too far the other direction.
We have at least three examples of this being an actual problem in practice that could not be worked around. Two in Java, and one in Golang itself. I don't know how you can come to the conclusion you did.
In particular, "struct composition" does not solve the problem any more than inheritance would in Java. This comes up in cases in which the structs in question have separate declarations and you don't want to force all of your method's callers to inherit from your class/embed your struct just to call your function.
- tptacek 12y agoI think the objection is that you rule out workarounds that involve rethinking decisions about what should be a struct, what should be an interface, and what things should be named.