From: "David A. Black" Date: 2005-05-12T23:24:40+09:00 Subject: Re: {} vs begin/end [was Re: object loops and what they return] Hi -- On Thu, 12 May 2005, Gavin Kistner wrote: > On May 12, 2005, at 7:35 AM, Robert Klemme wrote: >> If you got thrown out you can come over to my camp ("it's on one line ? >> use braces : use 'do ... end'") - we have plenty of space over here. As >> you can see I also frequently visit the ternary operator camp... > > I like the ternary folks, we hang out quite a bit. > > But you single-line/multi-line folks are...well...odd. From 1.8.2 lib: $ grep " do " `find . -name "*.rb"` | wc -l 1104 $ grep " do " `find . -name "*.rb"` | grep "end" | wc -l 37 $ grep "{ *|" `find . -name "*.rb"` | wc -l 1047 $ grep "{ *|" `find . -name "*.rb"` | grep "}" | wc -l 647 I know, it's not 100% reliable... but it suggests that, at least roughly, 3% of 'do' blocks end on the same line, while 62% of {} blocks end on the same line. So this "odd" behavior is actually pretty canonical :-) David -- David A. Black dblack@wobblini.net