4 ms·
My big quibble with this is that the OO category is way too narrow. The way it is worded it excludes almost all languages we'd currently consider OO, and is so
by vidarh 4y ago
My big quibble with this is that the OO category is way too narrow. The way it is worded it excludes almost all languages we'd currently consider OO, and is so strict it largely makes the category pointless. Loosen it to exclude the "You do conditionals..." bit, and focus on the message passing, and e.g. Ruby and other languages that are message passing focused to the point of it tending to dominate semantics over it's Algol-related syntax fits firmly in this category.
Listing Self rather than Smalltalk as the basis of OO languages is also a bit odd. Calling it a "purer form" I guess is a justification, but the other view is once you losen the definition as above, self is just the root of one small (albeit influential, via Javascript, branch of OO languages that almost all owe more to Smalltalk than Self. If another language than Smalltalk should be at the root, it should be Simula, for inspiring message passing, not Self.
- TheRealPomax 4y agoI'm a bit confused about this quibble when the article text is about "Self and Smalltalk", not just Self? If anything the quibble should be "why is the section called Self when it's about the _two_ ur languages Self (the ur language for prototype based OO) and Smalltalk (the ur language for class based OO)"?
- vidarh 4y agoThe title is "Self (object oriented programming)" and it ends with "Self disposed of the notion of class and worked solely with objects. As this is a purer form, I have chosen Self as the type specimen for this ur-language", so while it gives Smalltalk the space it deserves, it then turns around at points out Self as the ur-language for OO.
- TheRealPomax 4y agoYou seem to confuse "ur language" for meaning "the original that others came from", which makes sense if you're familiar with the term "ur", but is not how this article uses the term. They use it to mean type specimen (as noted in the article). As type specimen, Self makes a lot more sense: it took the OO concepts pioneered by Smalltalk and then made them even more OO.
- vidarh 4y agoAs type specimen self makes less sense to me. In that sense it might make sense as the ur-language of it's own type (prototype-based OO languages), but it's too specific to be a specimen of the overall OO category. I don't agree it made the concepts more OO in any sense. Self's changes feel far less significant than what Smalltalk brought to the table. That an object inherits it's structure and functionality from something that is itself an object is true of all Smalltalk derived languages I'm aware of, after all.
- TheRealPomax 4y agoSmalltalk says "objects are instances of some class of thing", whereas Self went "no, objects are just objects, and what class of thing they are is mutable". Since we can get from Self's model to Smalltalk's model by adding restrictions on what you can do to both objects and prototypes, Self is quite objectively a better type specimen. I wouldn't call it an "ur language", that was a silly choice in term, but as basis for discussing OOP models, it's the most permissive, and you can get the other OOP models by adding various (sets of) restrictions. (Much like how a regular grammar is a context free grammar with additional rules)
- vidarh 4y agoI suspect we'll have to agree to disagree on this, as I don't agree with you at all that it is "objectively a better type specimen". I'd argue it's not even a good type specimen, in that it shares fewer characteristics with the majority of OO languages than Smalltalk does. The defining aspect of OO languages if we go by Kay is message passing and late binding. How that is achieved is secondary to the classification. Both Self and Smalltalk provides that, but Smalltalks way of providing that is more typical of the class of languages as a whole. To me, either Kay is authoritative, or we go the other direction and include more of the ALGOL-derived languages. In neither case is Self a good representative of what OO languages are like, and that to me makes it a poor type specimen.
- TheRealPomax 4y ago
- codeflo 4y agoI always thought that the "message passing" style of OO (which I always hated as a term, because it implies asynchronicity, but I digress) is firmly something else than the "classes and interfaces" style of OO, and that it's an unfortunate accident of history that we give them the same name.
- vidarh 4y agoI think part of the problem of trying to separate the two is that the most prominent implementations appear deceptively similar on the surface, even with unfamiliar syntax. E.g. put even Smalltalk in front of someone familiar with C++, and they'll quickly latch on to the similarities once a few of the basics are explained, to the point that explaining message passing as different from method invocation is tricky, not least because so much of message dispatch is implemented in terms of method invocation. This is ironically exacerbated when what is often presented as the important bit of Smalltalk are examples like the one in the article of allowing definition of control structures (you can do that in Ruby too, e.g. a partial impl: "def true.ifTrue = yield" - now you can do "(1 < 5).ifTrue { ... called if true }" - with a bit more thought you can chain ifTrue/ifFalse). But while that's neat, that doesn't even require dynamic dispatch, just the combination of being able to invoke methods/dispatch messages to true and false, combined with convenient syntax and support for closures. You could add that to a language and still not have a Smalltalk descendant in any meaningful way. What matters much more is that objects at least may take control over the target of a message dispatch even if they often don't, whereas method invocations in "those other" OO languages is mainly controlled by the class definition, and that is often glossed over as an advanced subject or "scary magic". For example how Ruby ORMs tend to use introspection to let you dynamically treat columns on database tables as methods based on the actual current schema of the database - in other words the ability to do not just dynamic dispatch but late binding.
- dfox 4y agoST80 does not really do the object controlled message dispatch that was there in earlier Smalltalks. Well, you can override Behavior>>#doesNotUnderstand: and do all sorts of cool tricks with that, but it is mostly meant as error-recovery path (which is partly apparent from the name), not as something that should be regularly used. One weird aspect of Smalltalk that more or less directly comes from the control structures implemented as messages taking blocks is that on the language level there are two distinct function-like objects: methods and blocks (ie. lambdas) that behave differently and interact with each other (return statement is scoped to method and only valid during the dynamic extent of said method invocation).
- notacoward 4y ago> Listing Self rather than Smalltalk as the basis of OO languages is also a bit odd. That was my first reaction too. I also agree that Simula deserves a mention here. AFAICT more languages derived from that model than from Smalltalk or Self directly, and I'm pretty sure the authors of later languages such as C++ have acknowledged as much.
- vidarh 4y agoYeah, most Stroustrup and Gosling has acknowledged that, at least. The reason I'd be ok with Smalltalk there is that Smalltalk at least was a significant break and you could argue that many of the "non-Smalltalk-y" OO languages are really ALGOL-derived languages that took some OO aspects (especially if you move Ruby out of the ALGOL bucket) in that most of them tend to combine support for both non-object types and objects, and have lots of constructs that operate on non-object values. As such I can see the merits in both/either of Smalltalk and Simula treated as the "ur-language" for OO in a way I can't for Self. Self is remarkable, but as I've mentioned before, more for the advances its implementation brought.
- Mesopropithecus 4y agoThe author's notion of OO is intentionally narrow. I don't know about Simula, but C++ is still reasonably close to Algol, compared to what Smalltalk and Self bring to the table (the author also mentions programming environments vs. text files). If you accept that narrow definition at least for the scope of the article, it makes sense.
- vidarh 4y agoIt's exceptionally narrow, in that it rules out the vast majority of languages that even purists would agree are OO. E.g. in Ruby you can not take the value of anything and get anything but an object (e.g. integers are objects, true is an object, nil is an object), but Ruby is not an OO language by the article's definition because it fails the part about conditionals. Even though you can do this in Ruby (probably buggy, just threw it together) - it's just not idiomatic and the language has syntactic sugar for "less OO" forms: def true.ifTrue; yield; true; end def true.ifFalse; true; end def false.ifFalse; yield; true; end def false.ifTrue; false; end (1 < 5).ifTrue { puts "TRUE!" }.ifFalse { puts "FALSE!" } # Or: (1 > 5).ifTrue { puts "TRUE!" }.ifFalse { puts "FALSE!" } So it might make sense if you accept that narrow definition, but I don't think many people will find that narrow definition to make sense. I certainly don't.
- OkayPhysicist 4y agoFrom the perspective of "Here is a list of language families from which you probably should learn at least one of each", the message-passing OO languages are completely divorced from the class-based OO languages. Tossing the latter in with the ALGOL languages is probably fine, as long as the actual language-to-learn recommendation is one of them.