Hacker News new | past | comments | ask | show | jobs | submit login

The difference between inheritance and composition as tools for code reuse is that, in composition, the interface across which the reused code is accessed is strictly defined and explicit. In inheritance it is weakly defined and implicit; subclasses are tightly coupled to their parents, and the resulting code is not modular.





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

Search: