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

I'd personally contest the notion that binding state and functionality directly together is "reasonably elegant" in the first place.

But ignoring that, it depends on the flavor of object orientation. Yes, the most mainstream style bundles state directly with functionality but not all do. But for instance the CLOS family of OOP maintains separate state and functionality and one binds desired functionality to those classes which should have it. This is not too dissimilar from typeclasses IMO.



It makes a lot of sense for modeling real world objects that can do things and have state.


Which makes a lot of sense for the situations where modeling real world objects that can do things and have state makes a lot of sense. Which isn't as often as the OOP advocates would have one believe.




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

Search: