4 ms·
I've always wondered why (implementation) inheritance is a first class construct while delegation has to be painstakingly implemented manually.
by _pmf_ 11y ago
I've always wondered why (implementation) inheritance is a first class construct while delegation has to be painstakingly implemented manually.
- jwdunne 11y agoI guess you could do this in a higher-level language like Ruby, though you either have to use a mixin or monkey-patch a core class, which isn't as clean cut as a first-class construct. With Lisp, you could just create the construct if it isn't there already. No such luck in Java et al.
- Ded7xSEoPKYNsDd 11y agoYes, I miss it in languages like Java and C# as well. But this is easy in prototype-based languages.