From: Phrogz Date: 2005-05-13T05:10:28+09:00 Subject: Re: {} vs begin/end [was Re: object loops and what they return] David A. Black wrote: > On Fri, 13 May 2005, Ben Giddings wrote: > > > I know it's way too late for the Ruby 1.X series, but I'd like to see a > > change for Ruby 2 that reserved braces for hashes and blocks had to have > > do/end. > > You'll have to fight it out with the ones who wanted braces for block > literals and hashes to be something else :-) /me fumbles around trying to find his personal sword to join the fray. I would agree that the duality of {} vs do/end is a bit odd and sort of unlike Ruby. (I could stretch and say "You can have arbitrary delimiters for all sorts of literals, so...blocks are sort of like that" but it would be a stretch.) I'd far, far prefer {} for blocks than only do/end. One of the greatest strengths of Ruby IMO is simple iterators using closures. You can do the exact same thing in Javascript, but it looks like this: myArray.each( function( obj ){ alert( obj ); } ); Obviously that's TERRIBLE. And the reason it's terrible is the large amount of crap you have to type to express a simple concept. The degree to which blocks become harder/longer to type is the degree to which Ruby loses some of its shine, IMO.