3 ms·
OOP was never "centered around deep class inheritance hierarchies". It was centred around message passing and dynamic method dispatch. The only significance of
by mikro2nd 3y ago
OOP was never "centered around deep class inheritance hierarchies". It was centred around message passing and dynamic method dispatch. The only significance of inheritance is to resolve the receiver of a message.
I feel strongly that most of the people who think OOP was bad are people who have only ever experienced C++/C#/Java or some even weaker instantiation of OOP.
What do you suppose you're writing when you implement a (micro)service? It's nothing different than an object -- some implementation whose details you don't need to care about when you use it, which details can be changed at any time without disturbing clients (modulo idiocy), and an interface that you use to communicate with it via messages.
And don't even get me started on the OO vs. Functional nonsense...
- gpderetta 3y agoSimula67, arguably the first OO language, was centered around inheritance. The other early major OO language was obviously Smalltalk which focused on message passing. Both C++ and Java were majorly influenced by Simula, while more dynamic languages take on aspects of Smalltalk.
- pjmlp 3y agoJava is clearly influenced by Objective-C and Smalltalk in semantics. Not only their authors are on the record saying so, Java EE is inspired in an Objective-C framework (Distributed Objects Everywhere), and Hotspot is the evolution of Strongtalk JIT.
- gpderetta 3y agoI'm sure that Objective-C and Smalltalk have also been strong influences, especially in the libraries. But I would say that the OO semantics are very Simula like. Can you really claim as Smalltalk inspired a language without an easy to use DoesNotUderstand? That's pretty much the basis for first class messages and transparent delegation. Also: https://www.youtube.com/watch?v=ccRtIdlTqlU https://www.youtube.com/watch?v=ccRtIdlTqlU edit: you could say that the JVM itself is more explicitly smalltalk-inspired as, AFAIK, has closer to fist class messaging support, but this power is hidden to the typical java program under a more interface oriented design. To reach the full power you have to escape form java into the meta-level via introspection.
- pjmlp 3y agoJava authors are quite clear where the semantics come from, https://cs.gmu.edu/~sean/stuff/java-objc.html https://cs.gmu.edu/~sean/stuff/java-objc.html The C++ like syntax was to make it more marketable. Java, like Smalltalk and Objective-C, and others in Xerox linage, is a full stack experience, naturally one cannot dissociate the language from the JVM, that is programming with one arm tied behind the back. Language and platform were designed to work together. As for doesNotUndertstand, for some limited use cases you would use dynamic proxies, https://docs.oracle.com/javase/8/docs/technotes/guides/reflection/proxy.html https://docs.oracle.com/javase/8/docs/technotes/guides/refle... Tutorial is for Java 8, but java.lang.reflect.Proxy exists since Java 3 (1.3). And as for reaching out to JVM low level stuff, there is invokedynamic, JVM version of .NET DLR. Also this meta-level programming is quite common in Smalltalk, when playing around with metaclasses, and Smalltalk APIs for the VM.