|
|
|
|
|
by _y5hn
1877 days ago
|
|
Maybe he meant something similar to Go interfaces, but they are abstract and coupled loosely with implementations after the fact. That or abstract class/pure interface. There's no need for default implementations introducing assumptions in code. |
|
While I take your point about introducing assumptions, I'm reluctant to give up the convenience of default implementations; they seem to present fewer problems than classically inherited methods because shallow hierarchies are more common with interfaces than with classical inheritance, and because default interface methods cannot directly access member variables because they do not know about object layout — unlike methods inherited from a parent class under classical inheritance.