| > That is exactly why the term "object-oriented" was originally coined for Smalltalk. Sure but your definition doesn't cover it. If language for which the term was coined, it's a bit meaningless, ain't it. Problem with making encapsulation and polymorphism essential to OOP definition, is that it then starts garbling up functional languages like Haskell and imperative like C. I can see them being necessary but not enough to classify something as OOP. > And when you look you'll soon find out that there is no commonality here. Perhaps, but broadly speaking people agree that C++ and Java are OOP, but for example C isn't. Same way when people say and give me a fruit (as in fruits and vegetables), you'd be looked oddly if you gave a cucumber, rather than an apple. Same way can be thought of OOP. The common definition is basically covers Message-passing-languages, and inheritance/prototype based languages. |
How does it not cover it?
> Problem with making encapsulation and polymorphism essential to OOP definition, is that it then starts garbling up functional languages like Haskell and imperative like C.
Polymorphism? That was never mentioned. Let me reiterate the definitions:
- Imperative: Plain functions (C, Fortran, Pascal).
- Functional: Functions with encapsulation (C++, Java, Haskell, Erlang).
- Object-oriented: Message passing (Smalltalk, Objective-C, Ruby, Erlang).
Let me also reiterate that there are other axis of concerns. Imperative, functional, and object-oriented are not trying to categorize every last feature a programming language might have. Mutable/immutable, or polymorphic/monomorphic, etc. are others concern and can be independently labeled as such.
> Perhaps, but broadly speaking people agree that C++ and Java are OOP
Many do, but just as many hold on to the original definition. Try as you might, you're not going to find a common definition here, I'm afraid. If you want to use the term effectively, you're going to have to explicitly define it each time.