3 ms·
I'd go one further and say that the way other languages do it does a better job of letting you define interfaces for types you don't control. Sometimes the type
by bunderbunder 9y ago
I'd go one further and say that the way other languages do it does a better job of letting you define interfaces for types you don't control. Sometimes the type you want to apply your interface/trait to doesn't have a function that does what you need, but could easily be assembled from other members of the type. And sometimes it does have a function that would work, except that the name is different.
There's an Uncle Bob talk I watched a while back where he suggests that oftentimes language designers will say just about anything to avoid admitting that the real reason a feature is absent or was implemented in a hacky way is for the convenience of the compiler's authors.