From: Austin Ziegler Date: 2002-11-04T08:15:10+09:00 Subject: Re: Thoughts on Ruby On Mon, 4 Nov 2002 06:22:35 +0900, Albert Wagner wrote: My problem with your cutting is that it placed several statements that I made together without the context that made the statements make sense in any way. > On Sunday 03 November 2002 2:34 pm, Austin Ziegler wrote: >> withAllChildrenDo: aBlock >> aBlock value: self. >> children ifNotNil: [children do: [:c | c withAllChildrenDo: >> aBlock]]! ! >> >> As I said before, I don't "get" Smalltalk. However, what I can see >> here is that there's four different symbols (!, :, |, []), and at >> least one of them does double-duty (:). It's not very clear at all >> -- in a reading sense -- what this does. I suspect that the >> equivalent Ruby is more readable, not least because it uses fewer >> symbols. > > No exact equivalence in Ruby: > > def recurseTree(&blk) > aBlock = self # pseudocode > children.each do {|c| c recurseTree(aBlock)} > end > > Hmmm...I see five different symbols here, and one of them does > double duty (|). Um ... no, pipe (|) doesn't do double duty. Specifically note that in the Smalltalk you have both "value:" and ":c"; that's what I mean by double duty. The same symbol has multiple meanings. In Ruby, the only symbol that I can think of which has multiple inherent meanings is {} (both a block indicator and hash definition indicator). >> (Note: we may actually be in violent agreement here, given your >> comments regarding "images", but I'm not sure.) >> >> Also, my comments on RPN (and thus Forth and, at least to some >> degree, Smalltalk) are simply empirical in nature. We don't >> generally teach people 3 3 + when we're teaching math. > RPN is not used in Smalltalk syntax. > > Smalltalk: x := 3 + 3 > Ruby: x = 3 + 3 I am not referring to mathematical expressions explicitly -- that's what most people associate with RPN, but Forth is a language based on RPN very explicitly. The RPNness that I'm specifically referring to is: ifTrue: ifFalse: This doesn't read naturally, even though it's somewhat sensible from an OO perspective. >> When you add these two items together, then it's not a leap to >> suggest that Smalltalk is harder to read and it doesn't seem as >> natural as a "conventional" language. This doesn't mean that >> Smalltalk is better or worse, but just *harder* to read. > ANY language that you do NOT know is harder to read than one you > DO know. So what's your point? That's not what I said. What I said is that because of its symbolic choices and its SOV ordering, Smalltalk is harder to read than the average programming language. Perl is hard to read because of its symbolic choices, even though it is a more traditional programming language. -austin -- Austin Ziegler, austin@halostatue.ca on 2002.11.03 at 18.03.55