2 ms·
Several comments have objected to this as if it were stupid: In an OOPL data type definitions belong to objects. So I can't find all the data type definition[s
by gruseom 18y ago
Several comments have objected to this as if it were stupid:
In an OOPL data type definitions belong to objects. So I can't find all the data type definition[s] in one place.
The point is that OO programs consist of many type declarations scattered everywhere. As complexity grows, it gets harder to understand what all the types are and how they are related. The textbook "shape" and "animal" examples never come close to revealing this problem: they're oversimplified and they refer to things already familiar from the world. In other words they rely on OO's roots in simulation, where it works ok. In any complex system, though, you have to go far beyond ready-at-hand concepts. You end up declaring all sorts of arbitrary types that exhibit the problem Armstrong is talking about. There isn't even an easy way to see what they all are.
It gets harder and harder to change such programs because changing one type definition entails changing others. You can change how the internals of a class work (where it reduces to functions operating on private state), but significant overhaul of the class hierarchy itself is an order of magnitude harder than it should be (than it is in a program where you just have functions).
Armstrong's reference to keeping everything in a single file is not because he believes everything should be kept in a single file. That should be obvious, since he's obviously not an idiot. His point is how much easier it is in certain non-OO languages to understand a program's type system.
I think this is a valid criticism of OO because it cuts to the core of what people claimed was great about OO: that it helps to organize complex programs better and that it makes complex programs easier to change.
Edit: Armstrong is obviously smart, and Erlang is a real contribution, but it is also true that he is not a very good writer. I find he's the kind of writer that I have to make an effort to understand, which in his case is worth it because his intuitions are worth paying attention to. Of course not everyone need feel that way. But some of the comments in this thread seem a little knee-jerk to me.
Edit 2: Smalltalk is pretty clearly an exception to all of this. This has puzzled me for a long time. It just hit me maybe why: Smalltalk is actually not an OO language. Not in the sense we talk about OO nowadays. We've all been misled by the fact that it was the original OO language and that its creator introduced the term. Smalltalk's greatness comes from another place entirely, which is why no other OO language has equalled it.
- kilowatt 18y ago...you really left us hanging there. Where does this supposed greatness-which-shall-not-be-named come from? The only distinguishing feature that I can recall about Smalltalk is that every operation is just passing a message--and that's certainly not unique among OO languages.
- gruseom 18y agoWell, I'm not sure; I'd have to program more in Smalltalk before I could say. But my guess is that it comes from the remarkable regularity of the language as well as, to quote Kay's definition of what he meant by OO, its "extreme late binding of all things" (I love that phrase!) These are the most interesting things about Smalltalk as well as the things that it has least in common with all the other languages called OO.