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
Ruckus
02/07/2017, 9:27 PM
orangy: I can see that. I've used interface delegation very rarely (though the times I did it save me hundreds of LOC).
Ruckus
02/07/2017, 9:27 PM
May I ask what about it you see as under developed?
o
orangy
02/07/2017, 9:28 PM
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.
orangy
02/07/2017, 9:29 PM
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
orangy
02/07/2017, 9:29 PM
Well, you can if you are lucky enough to have delegate instance as primary constructor parameter.
orangy
02/07/2017, 9:30 PM
See, so many “but”, not universally applicable to most common use cases, often needs “unwrapping” to manual delegation because of limitations.
r
Ruckus
02/07/2017, 9:33 PM
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
mg6maciej
02/07/2017, 9:40 PM
Inheritance is the root of all evil 🙂
mg6maciej
02/07/2017, 9:40 PM
I like the way things work in Go in relation to delagation.
c
cedric
02/07/2017, 9:44 PM
@mg6maciej Did you mean “Inheritance is the superclass of all evil”?