From: Marnen Laibow-Koser Date: 2010-01-12T02:29:55+09:00 Subject: Re: Help Marc Heiler wrote: >> For oneliner I just think both them are the same. >> Just take the one you like to write.:) > > I can agree with the statement, at least partially, but I must say that > in oneliners I really prefer the {} notation compared to do/end on one > line. Yes, that's standard style. > > Also, I found myself doing this sometimes: > > > def some_method > array.map! {|i| > call_method_one > call_method_one > another_method_here > i.strip > } > end > > And so forth. I am aware that smaller methods are usually better than > long methods, but in the case where I really have long methods, I came > to appreciate using {} instead of do/end, because I like to see the > closing } as finishing that statement. That is nonstandard style. Ruby isn't supposed to look like C or Java. :) Use do/end for multiline blocks. Best, --  Marnen Laibow-Koser http://www.marnen.org marnen@marnen.org > > Compare this to this code: > > def some_method > array.map! do |i| > call_method_one > call_method_one > another_method_here > i.strip > end > end > > I don't really like the two ends. The } makes my eyes happy, and my poor > brain happy as well, and if Ruby doesn't mind either way then I try to > stick to the first method. -- Posted via http://www.ruby-forum.com/.