Take for example interface delegation feature in K...
# language-proposals
o
Take for example interface delegation feature in Kotlin. I personally think it was a mistake to put it in a language, though it is extremely useful at times.
r
orangy: I can see that. I've used interface delegation very rarely (though the times I did it save me hundreds of LOC).
May I ask what about it you see as under developed?
o
Most of the time I need to get an instance interface was delegated to inside a class. Few times I needed to delegate an abstract class and not an interface.
Most simple case is when you want to delegate 99 methods as is, and only one do something before/after and still delegate. You can't
Well, you can if you are lucky enough to have delegate instance as primary constructor parameter.
See, so many “but”, not universally applicable to most common use cases, often needs “unwrapping” to manual delegation because of limitations.
r
Ah, I see. Delegating to abstract classes is something I've wanted for a while. It would help a ton with some GUI and game frameworks. I haven't yet needed to delegate to an instance inside the class, but I can definitely see how it would be useful conceptually.
m
Inheritance is the root of all evil 🙂
I like the way things work in Go in relation to delagation.
c
@mg6maciej Did you mean “Inheritance is the superclass of all evil”?
😈 2