3 ms·
OOP has nothing to do with classes, inheritance, especially multiple inheritance. It's about programming objects that communicate with each other. In fact Javas
by mempko 9y ago
OOP has nothing to do with classes, inheritance, especially multiple inheritance. It's about programming objects that communicate with each other. In fact Javascript and it's prototype system are much more OOP than say C++ classes, or worse, Java classes.
We should call programming with classes and inheritance. COP, as in Class Oriented Programming. COP is especially appropriate because if you don't follow the type rules, you go to compiler jail.
- platz 9y ago> OOP has nothing to do with classes, inheritance, especially multiple inheritance. It's about programming objects that communicate with each other. That is the Alan Kay definition. I'm not sure I'd claim that is the colloquial, universal understanding of OOP apart from the HN crowd, though. (ask a LOB programmer what OOP is and observe what they say). I rather like the Alan Kay definition myself, but that is rather like having a Many Worlds understanding of quantum mechanics; Entirely consistent and arguably "correct", but not universally shared among practitioners. We should refine our language (e.g. COP), but it would be revisionist to ignore what the 90's and 00's understanding of the definition would be. I think it would be even more of a stretch to say that prototypal languages (javascript) are more OOP than non-prototypal languages, unless of course one is being a bit reductionist.
- munificent 9y ago> In fact Javascript and it's prototype system are much more OOP than say C++ classes, or worse, Java classes. I'm not sure what your ordering relation is here, but if it has something to do with how "purely object-oriented" a language is, then, sure, JavaScript is more OOP than C++ and Java since classes are not first-class in the latter. But Smalltalk, which is class-based, is even more OOP than JavaScript since in Smalltalk, constructor calls are simply regular method calls (unlike JS which has a special "new" keyword) and there are no primitive objects (unlike JS, which distinguishes between primitive types and their boxed forms, though it tries to obscure that fact). > COP is especially appropriate because if you don't follow the type rules, you go to compiler jail. Smalltalk, Ruby, and Python are all class-based OOP languages but do not have static type systems with lots of compiler errors.
- lliamander 9y ago> It's about programming objects that communicate with each other. This becomes even more apparent when using an actor-model language like Erlang. The types of "design patterns" you use focus much more around the communication and coordination you might find in real, physical systems. Consequently I find it easier to model "real" systems using actors than standard objects in a language like Java. I also appreciate how the Pony language decomposes the notion of "objects" into actors that have their own process and capabilities (standard objects). It shows that their is a distinct role for both types of objects, and it helps when decomposing entities in a system.
- goatlover 9y agoThat entirely depends on who you ask. If classes and inheritance aren't a form of OOP, then what are they? Also, Smalltalk had classes and inheritance, whatever Alan Kay had to say on the matter.