Hacker News new | ask | show | jobs
by samg_ 5663 days ago
I find that it can be valuable in a GUI toolkit. If I want to change a small part of a UI component, I can subclass it, change what I want, keep the rest, and classes that used the old component can use the new one too, because of subtype polymorphism.

Composition can work for a lot of these problems too. It depends on the scale of the modification, I guess.