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

OO can be a tree, as well as pretty arbitrary graphs. As has been said for over a decade, prefer composition over inheritance. There are cases where inheritance is really cool, but the main point of OOP is encapsulation. It can enforce class invariants.


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

Search: