Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: