Hacker News new | past | comments | ask | show | jobs | submit login

I would say the defining property of OO, is polymorphism. It's the property that allows some code to call a Bar() method on object Foo and not be concerned with the exact type of object Foo. Without polymorphism, there is little differnce between Bar.Foo() and Foo(Bar).

Implementation inheritance is a property of _some_ OO languages and one that is hard to imagine separate from OO. Which is why perhaps so many insist upon it being a required property for some language to be called OO. I am firmly in the camp that thinks implementation inheritance is a bad idea and it is best to avoid it even in langauges that support it. Thus I don't agree with anyone who claims that it is an important characteristic of a language.

Whether object instances find their genesis in classes, factories or prototypes are IMO the least important aspect to consider when discussing whether or not some language is truly OO. It's the object instances that do the important work. Where they came from is not so interesting.




> I would say the defining property of OO, is polymorphism.

Make it dynamic polymorphism, and I agree.


Subtype polymorphism. Dynamic dispatch.

http://en.wikipedia.org/wiki/Subtype_polymorphism

http://en.wikipedia.org/wiki/Dynamic_dispatch

Polymorphism is a feature of the type system, and thus inherently static. Dynamic dispatch is something you often wind up with as a consequence of subtyping, but neither requires the other, strictly speaking.


subtype polymorphism




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: