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

discuss() and fight() and makelove() are usually (hopefully!) commutative.

I think the more interesting observation to make is: what is the type of the argument to discuss? SentientBeing? CanDiscussMixin?

In the first case, I bet you could imagine objects to "discuss" with that would only awkwardly inherit from SentientBeing, and in the second, your major objects will quickly grow loads of mixins. Of course there's also the "implements interface" appproach.

I think all the models break down at some point...maybe the choice of which one to use is dependent on the problem.



Actually, what I was leading up to was that _neither_ is "valid". The better way (in this case) would be:

  discuss (TweedHeads, visitor4rmindia);
This, to me, underlines some of the problems of the OOPS approach. Everything starts "looking like" methods even when they would be more natural as simple functions.




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

Search: