logoalt Hacker News

mdaniellast Wednesday at 8:37 PM0 repliesview on HN

Contrast the Java way

    class Delegated implements Base {
        final Base b;
        public Delegated(Base b) { this.b = b; }
        @Override
        public void printMessage() { b.printMessage(x); }
        @Override
        public void printMessageLine() { b.printMessageLine(x); }
with the Kotlin way https://kotlinlang.org/docs/delegation.html#overriding-a-mem...

OT1H, yes, sane people using IJ would just alt-Insert, choose delegate to, and move on with life. But those misguided folks using VS Code, vim, or a magnetized needle and a steady hand would for sure find delegating to a broader interface to be a huge PITA