From: William Djaja Tjokroaminata Date: 2002-09-26T23:34:35+09:00 Subject: Re: call for commentary: review of Ruby for a magazine (long, sorry!) Dave Thomas wrote: ----------------------------------------------------------------------- > Except the conventional Ruby syntax > puts "warning" if obj.nil? > is actually one less keystroke, and a shifted key one that (on my > keyboard...) Actually, the above code is valid in SRuby :) So, if you want to write it that way, you can. I personally just limit myself to minimalism (very few beginning keywords). ----------------------------------------------------------------------- > It seems to me that all you've really saved is typing 'end' > keywords. If you happened to use Emacs, there's a neat function called > g0-ruby-end-block that automatically inserts the 'end' and adjusts the > indentation when you type (in my case) ALT-Return. > I've been translating some Python in to Ruby, and I'm finding that if > I use Ruby idioms, rather than just copy the code statement for > statement, the Ruby is about 10-15% fewer statements than the > equivalent Python. I'm not sure that losing the 'end's will really > make that much difference. ----------------------------------------------------------------------- Yes and no. For me, because that "end" is at the same indentation level as the next keyword, my eyes have more difficulty in detecting the keyword. Also, with this syntax, I usually don't write the extra blank lines anymore, so I can see more code in a screen page, and it means less scrolling. :) I think you are absolutely correct that the Ruby code is in general smaller than Python. But by retaining the Ruby semantics while using Python-like syntax, I think I have minimized the source code. Cheers, Bill