From: Austin Ziegler Date: 2002-11-04T04:43:00+09:00 Subject: Re: Thoughts on Ruby On Mon, 4 Nov 2002 04:12:39 +0900, Albert Wagner wrote: > On Sunday 03 November 2002 5:53 am, Anders Bengtsson wrote: >> Albert Wagner wrote: >>> Smalltalk is pure OOP. Ruby is not. In Smalltalk the "operators" >>> are simply messages to an object. In Ruby "operators" are >>> neither objects nor messages, but are rather handled as in more >>> conventional languages. I don't know why Matz only went part >>> way. This part-way-ness is also visible in other aspects of the >>> language such as "if", "while", etc. In Ruby these things also >>> are neither object nor message. Whereas in Smalltalk, such >>> constructs are messages to a Boolean object. >> If Ruby went all the way on this, like Smalltalk does, then Ruby >> would almost *be* Smalltalk. The unique about Ruby is that it >> combines the OO-ness of Smalltalk with a more conventional >> syntax. I love Smalltalk's syntax, but it did scare a lot of >> people away. > Yes, superficially, just looking at a piece of Smalltalk code, > without understanding what it means, a lot of people come away > with the wrong idea: "Smalltalk syntax is wierd and complicated". > Actually, Smalltalk syntax is absurdly simple: There are ONLY > objects and messages. e.g. > > conventional language: > > if > codeExecutedIfBooleanIsTrue > else > code ExecutedIfBooleanIsFalse > end > > Smalltalk: > > > IfTrue: [ codeExecutedIfBooleanIsTrue] > IfFalse: [ codeExecutedIfBooleanIsFalse] [...] > It is this consistency in pure languages that cause problems for > people coming from such languages to Ruby. The corrolary is people > coming from simple procedural languages (C) and hybrid languages > (C++) who have trouble grasping the almost pureness of Ruby. Ruby > sits midway between canonical pure OOP (Smalltalk) and > procedural/hybrid languages. Whether you enter Ruby from the left > or right you are bound to be suprised. This helps me understand Smalltalk better, but it doesn't fix the fundamental problems that I have with Smalltalk that I don't find with Ruby. First, I find that Smalltalk has too many symbols. It looks like line noise without the clarity of Perl /-: Second, it doesn't read naturally. I think Forth is a neat language, but RPN isn't a "natural" way of reading things. It looks odd. As I mentioned in a different response to this thread, I think that "a + 3" is definitely easier to read than "a 3 +". To me, Smalltalk reads like RPN and Forth and this makes it harder to read. Even comparing your boolean example, the procedural reads easier than the Smalltalk version. Further, the procedural version easily allows chained boolean tests (e.g., if ... elsif ... elsif ... end) that the Smalltalk version doesn't lend itself to. I'm not a Smalltalker, so while there might be a way of doing that, it doesn't seem as natural. -austin -- Austin Ziegler, austin@halostatue.ca on 2002.11.03 at 14.24.10