| > Sure but your definition doesn't cover it. 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. |
Sigh. Look at what started this whole discussion.
It's pjmlp's insistence that Rust is object-oriented.I'm fine with object-oriented meaning message passing.
I'm fine with object-oriented being used to describe inheritance based langs Java/C#/C++.
But where that fails miserably is when you try implementing inheritance based stuff like DOM in Rust.
You can't have your cake (all capabilities of OOP) and also eat it too (also most of them missing).
Rust was never about inheritance hierarchies or message passing.
It's just structs with privacy modifiers. And functions that are applied to them.