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

This makes an important point that too few people understand. "Inheritance of implementation" is a rare trick. It's something appropriate to only a small fraction of problems. I constantly see people trying to use inheritance as an extension mechanism (i.e. "just inherit from this class to use the library"), and it's just a disaster.


Yeah. I think Apple's Cocoa framework is a good example. Instead of inheritance you use delegates to modify class behaviour. Subclassing is 100% possible but not very often required because of the delegate pattern.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: