From: "Curt Sampson" <cjs / cynic.net> > On Sat, 12 Feb 2005, Adriano Ferreira wrote: > > > Without offense, one can say that Ruby is Smalltalk made right (or at > > least one way to make it right). > > If if by "making it right" you mean going back to imperative languages > and irregular syntax. > > Smalltalk already had pretty good iterators; why add the imperative > "while"? Smalltalk itself is so powerful that it doesn't even have an > "if" statement. Ruby is that powerful too, but a lot more awkward. > (It's probably more awkward because it does have an "if" statement and > therefore never had to make things like a generic block statement that > was as syntatically light as possible.) > > And I find the highly irregular syntax very frustrating. What does > something in braces mean, for example? It depends on where it appears > in the program. Why do I use one syntax when passing only one block to > a method, but a different syntax when passing two? And so on. Irregular > syntax combined with too many different ways of doing things makes > learning much harder, becuase you can't naturally work out how to do > things, you need to discover the tricks. I love elegant syntax. That Smalltalk didn't need an "if" statement was something that instantly attracted me to the language. Smalltalk and Lisp are at the pinnacle of elegant simplicity in language design, to me. And yet I think Matz has accomplished something truly unique, and equally impressive, in finding a way to blend the best traits of Smalltalk and Perl. I used to literally think to my self, If only there were a way to have the best of Smalltalk and Perl, . . . and before I stumbled upon Ruby, I used to laugh that off as an impossibility. True, the syntax winds up nowhere near as simple as Smalltalk or Lisp. Interestingly one of the slides in one of Matz' presentations on Ruby was entitled, "Simplicity is NOT a Goal" - http://www.rubyist.net/~matz/slides/oscon2003/mgp00047.html But it Matters to me that in Ruby I can do things like: ruby -e "puts ARGF.read.scan(/\d+\.\d+\.\d+\.\d+/).uniq.sort" or: ruby -i -pe 'gsub(/#!\\Perl\\bin\\perl.exe/, "#!/usr/bin/perl")' *.cgi I think that Ruby's design is extremely elegant; just not extremely simple. (As a side note, I've found it amazing how many of the guiding precepts and philosophies Matz enumerates in his slides about Ruby's design are almost tangibly visible in ruby itself. I don't know if I'm explaining myself adequately here; I just compare that to an imaginary list of slides for the guiding principles behind the design of the Visual Basic syntax, which I imagine would read, "Duhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh." :) I guess primarily what I'm trying to get across is that while I agree about the amazing genius simplicity of Smalltalk syntax, instead of finding ruby's "highly irregular syntax" frustrating, I find it powerful (and still elegant, even if not simple.) Regards, Bill