"Object-oriented programming" in its basic form means that the data manipulated in a computer program is self-describing. We can ask a datum, "what are you? what type?". The functions of that program are organized around data. This is in contrast with the form of programming in which data is just some storage, which is given a meaning by the algorithm that operates on it; it is not self-describing.
Self-describing data lets us then have generic operations. For instance, if an object hold a sequence of other object, we can create an operation which extracts the N-th one. And we can make that same operation work for an object which is a character string, vector, list. This is because the function can inquire the object what it is, and then call the appropriate concrete implementation which does the right thing for that type.
This leads us to realize that type is connected to the operations which are applicable. Those objects are somehow of the same "kind". This gives rise to the concept of subtyping and substitutability: a string is a kind of sequence and so is a list and we can have operations on sequences.
The non-object-oriented concepts are all that cruft from various languages which tries to strangle OO: virtual base classes, protected members, methods within class scope, scope resolution, copy constructors, yadda yadda ad nauseum ...
We are led to believe that OO requires this or requires that. It's not OO if there is no encapsulation. It's not OO if there is no language-enforced "information hiding". It's not OO if there is no private/public access mechanism. It's not OO if method calls aren't represented as message passing. It's not OO if methods aren't in a compile-time class scope together with data members. ...
Kazinator's comment struck me as a lucid definition. APIs and ADTs let the thing's behavior define the thing, and subtyping and substitutability emerge from thinking about generic operators defined on more than one kind of datum.
My bet is even Smalltalk programmers don't think of eggs as knowing how to scramble themselves; but eggs do have an API, a behavior, that makes them distinct from other kinds of objects and at the same time shares characteristics with other objects, such as weight and dimensions.
I can assemble a list of eggs, elephants, and cars, and write "take the sum of the weights of all the objects". Although these objects are of different kind, they share a common characteristic that would be exploited naturally by any language user. Exploiting multiple "views of a thing" is a feature of English ("natural language") and to my mind is a feature of any successful "generic programming" computer language.
Processes communicating by asynchronous message passing is a better simulation of the familiar world; but that vision is not realized by Smalltalk, wherein messages are passed synchronously. What we want from language is the ability to write powerful sentences and have them mean something to the machine -- as long as the computer and human agree on the meaning. The better part of this power comes from a sophisticated treatment of type and generic operators.
The term "object-oriented" was coined by Alan Kay, and he did provide a much more precise meaning. Unfortunately, the term became a fad and was then diluted into all sorts of vaguely related ideas.
The page you link seems to indicate that Kay didn't propose this as a definitive definition of OOP, but rather as a description of the defining features of Smalltalk. I'm not familiar with the document; do you have any insight?
Kay's concept survives if you substitute "function call" for "message". Sending a message to an object and receiving a reply is closely analogous to invoking a function and obtaining a return value. Unfortunately, his overall model implies single dispatch. Sure, "everything is an object", but only one thing is the leftmost argument: the thing that receives the message; and the other things are just arguments.
If the point is to argue that OOP is not a valid concept, the author should show first that 'programming' is a valid concept (using the same definitions) and that there are some related concepts (e.g., 'functional programming') that are valid, because if the same argument can be applied to most or all other '* programming' concepts too (not to mention concepts like 'validity' and 'concept'), then the point is not specific to OOP at all.
The author's case is based upon Harriman's account of induction in the natural sciences. I don't think that's appropriate here. Computer Science -- or at least PL/Software Engineering -- is not a physical science! In many cases it's not or historically wasn't even a mathematical science.
Furthermore, all programming paradigms suffer the same fate in popular/industry press (even if not within academic communities). For instance, productivity claims justified by the macros and dynamic typing of Schemes and Lisps are often implicitly cross-applied to MLs under the broad header of "FP". And vice-versa for safety claims about MLs germane to types.
Sure, some people are careful about this sort of thing. But some aren't, which can make the concept of FP a "grab-bag" in certain settings. That doesn't (or shouldn't) make FP a "non-concept".
(It appears you beat me to this punch, so I'm moving my comment here instead of fragmenting this point into 2 top-level comments.)
Well, the author recommends induction as a means of figuring this out, and it seems for induction to work we need to have some existing example to induce the principle from (if I am remembering my maths, I might not be). So to figure out our concept it may be worth taking a look at what the use of object-oriented features is, and use that as a starting point. Maybe, again I am a little rusty on my inductive reasoning.
I think one thing that strikes me with Object-oriented programming in general is the idea of data management and function management.
I guess if we look at the features that are associated with object-orientation (I am not pretending that I am being strictly inductive at this point, although I think this is vaguely inductive), I would say that it takes the management and organization of programming concepts, such as data and function organization, and embeds it into the language itself.
The article author was referring to inductive reasoning in the sense of epistemology, which is not the same as mathematical induction. In fact, mathematical induction is a deductive reasoning technique.
The mainstream programming language community has a pretty strong consensus on what OOP means, in terms of language features.
Some people out there seem to have some confused notions of what OOP is. That doesn't mean there isn't a well-understood and more-or-less accepted definition, at least in academia.
Edit for downvotes: dynamic dispatch + associating methods with classes, often times but not necessarily accompanied by an inheritance hierarchy. Of course there's lot of room for design decisions (and prototype-based languages are only awkwardly encapsulated in that group), but these features are basically unique to OOP languages.
The point is that you could put a language with these features in front of any random sample of PL researchers and they would probably more-or-less agree on whether the language has OO features. That's more or less the definition of scientific consensus.
There is such a thing as object-oriented programming; the author just hasn't encountered it through the tools that he was led to believe were OO programming tools.
"I didn't find Tao in Java or GoF" does not imply "there is no Tao".
“OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things.” — Alan Kay
It's easy to assume only languages with Class and Object abstractions are "object-oriented", but the "orientation" is really more about your mental model of the system as differentiated objects that communicate via messages.
Programming in C which isn't "object oriented" is very similar to say, Java. You make the same architectural diagrams on a whiteboard for both. So I agree with the author.
Java is a deeply flawed object oriented language. You agree with the author because, correctly, you are experiencing that Java barely supports object oriented programming. Not that there is no such thing.
[edit: Why the downvotes? I'm not saying java is bad - just that it isn't a strong representation of object orientation. If you take Java as the examplar of object orientation, then you will reasonably conclude that Object Orientation is a weak concept.]
kazinator|11 years ago
Self-describing data lets us then have generic operations. For instance, if an object hold a sequence of other object, we can create an operation which extracts the N-th one. And we can make that same operation work for an object which is a character string, vector, list. This is because the function can inquire the object what it is, and then call the appropriate concrete implementation which does the right thing for that type.
This leads us to realize that type is connected to the operations which are applicable. Those objects are somehow of the same "kind". This gives rise to the concept of subtyping and substitutability: a string is a kind of sequence and so is a list and we can have operations on sequences.
The non-object-oriented concepts are all that cruft from various languages which tries to strangle OO: virtual base classes, protected members, methods within class scope, scope resolution, copy constructors, yadda yadda ad nauseum ... We are led to believe that OO requires this or requires that. It's not OO if there is no encapsulation. It's not OO if there is no language-enforced "information hiding". It's not OO if there is no private/public access mechanism. It's not OO if method calls aren't represented as message passing. It's not OO if methods aren't in a compile-time class scope together with data members. ...
tailrecursion|11 years ago
My bet is even Smalltalk programmers don't think of eggs as knowing how to scramble themselves; but eggs do have an API, a behavior, that makes them distinct from other kinds of objects and at the same time shares characteristics with other objects, such as weight and dimensions.
I can assemble a list of eggs, elephants, and cars, and write "take the sum of the weights of all the objects". Although these objects are of different kind, they share a common characteristic that would be exploited naturally by any language user. Exploiting multiple "views of a thing" is a feature of English ("natural language") and to my mind is a feature of any successful "generic programming" computer language.
Processes communicating by asynchronous message passing is a better simulation of the familiar world; but that vision is not realized by Smalltalk, wherein messages are passed synchronously. What we want from language is the ability to write powerful sentences and have them mean something to the machine -- as long as the computer and human agree on the meaning. The better part of this power comes from a sophisticated treatment of type and generic operators.
l_dopa|11 years ago
TelmoMenezes|11 years ago
http://c2.com/cgi/wiki?AlanKaysDefinitionOfObjectOriented
I find the original idea deep and worth thinking about.
techadv|11 years ago
pfraze|11 years ago
1. http://www.youtube.com/watch?v=oKg1hTOQXoY
kazinator|11 years ago
calvins|11 years ago
If the point is to argue that OOP is not a valid concept, the author should show first that 'programming' is a valid concept (using the same definitions) and that there are some related concepts (e.g., 'functional programming') that are valid, because if the same argument can be applied to most or all other '* programming' concepts too (not to mention concepts like 'validity' and 'concept'), then the point is not specific to OOP at all.
Incidentally, http://en.wikipedia.org/wiki/Prototype_theory seems a much better starting point for thinking about concepts in general, and '* programming' in particular.
techadv|11 years ago
Furthermore, all programming paradigms suffer the same fate in popular/industry press (even if not within academic communities). For instance, productivity claims justified by the macros and dynamic typing of Schemes and Lisps are often implicitly cross-applied to MLs under the broad header of "FP". And vice-versa for safety claims about MLs germane to types.
Sure, some people are careful about this sort of thing. But some aren't, which can make the concept of FP a "grab-bag" in certain settings. That doesn't (or shouldn't) make FP a "non-concept".
(It appears you beat me to this punch, so I'm moving my comment here instead of fragmenting this point into 2 top-level comments.)
unknown|11 years ago
[deleted]
unknown|11 years ago
[deleted]
InfiniteRand|11 years ago
I think one thing that strikes me with Object-oriented programming in general is the idea of data management and function management.
I guess if we look at the features that are associated with object-orientation (I am not pretending that I am being strictly inductive at this point, although I think this is vaguely inductive), I would say that it takes the management and organization of programming concepts, such as data and function organization, and embeds it into the language itself.
techadv|11 years ago
Here's the relevant wiki article: http://en.wikipedia.org/wiki/Inductive_reasoning
techadv|11 years ago
Some people out there seem to have some confused notions of what OOP is. That doesn't mean there isn't a well-understood and more-or-less accepted definition, at least in academia.
Edit for downvotes: dynamic dispatch + associating methods with classes, often times but not necessarily accompanied by an inheritance hierarchy. Of course there's lot of room for design decisions (and prototype-based languages are only awkwardly encapsulated in that group), but these features are basically unique to OOP languages.
The point is that you could put a language with these features in front of any random sample of PL researchers and they would probably more-or-less agree on whether the language has OO features. That's more or less the definition of scientific consensus.
yummyfajitas|11 years ago
So Julia and Clojure are object oriented? Some "object-oriented" julia code:
Even Haskell might qualify, due to existential types.http://www.haskell.org/haskellwiki/Existential_type
kazinator|11 years ago
"I didn't find Tao in Java or GoF" does not imply "there is no Tao".
audionerd|11 years ago
“OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things.” — Alan Kay
It's easy to assume only languages with Class and Object abstractions are "object-oriented", but the "orientation" is really more about your mental model of the system as differentiated objects that communicate via messages.
mpweiher|11 years ago
dang|11 years ago
a3voices|11 years ago
gress|11 years ago
[edit: Why the downvotes? I'm not saying java is bad - just that it isn't a strong representation of object orientation. If you take Java as the examplar of object orientation, then you will reasonably conclude that Object Orientation is a weak concept.]