From: Daniel Schierbeck Date: 2005-12-09T00:07:36+09:00 Subject: Re: do/end vs braces Steve Litt wrote: > Hi all, > > It looks to me like when you use an iterator (each for instance), you can make > the block either from a do/end pair, or from curly braces. All things being > equal, I'd greatly prefer to use do/end. Are there any differences in runtime > speed, capabilities, or Rubyness? There's a slight difference in how they're parsed. foo bar { block } is the same as foo(bar { block }) while foo bar do block end is the same as foo(bar) do block end or foo(bar) { block } but it's only an issue when you leave out the parantheses. The styling convention is that the curly braces are used for one-line blocks and the do..end for multi-line blocks foo { make_me_a_bar } bar do foo = Foo.new pass_the_foo(foo) do_something_else end Cheers, Daniel