News for hackers. Stuff that matters.
Re:Half a million lines of Go by vips7L on Monday May 17, 2021 @09:26AM (#27183108)
Do you really want to inherit all the functions of Collection? Isn't this the anti-pattern everyone complains about on inheritance vs composition? This just looks like it's confused about whether it is a collection or has a collection.

Personally, I'd just rather take a collection by composition and only expose the small part of the API I actually want.

I guess though this is the standard decorator pattern you'd normally see from GoF.

Re:Half a million lines of Go by dcow on Monday May 17, 2021 @11:30AM (#27184575)
It also breaks LSP when you “extend but reduce”. Not saying there aren't uses for “have-a”. More that writing a decorator in Java is awful.