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

Not GP, but I'd definitely call that a positive! That's one of my issues with single-inheritance OOP too... There are many hierarchies you might want depending on the aspects you're interested in.

"A glass of juice is certainly a drink, but it is also a source of nutrition -- but not every drink is. There's not much nutrition in a glass of water. Likewise, there are many sources of nutrition which are not drinks. [...] A cup of tea is technically a source of energy (it is hot, it contains thermal energy), but so is a battery. Do they have a common base class?"[1]

(I remember a better example using soft drinks, but I couldn't find it with a quick google)

[1](https://stackoverflow.com/a/1079003/5534735)



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

Search: