From: Julian Leviston Date: 2007-05-18T18:07:22+09:00 Subject: Re: Why not adopt "Python Style" indentation for Ruby? Actually, Isn't end repeating yourself full stop? Do we really need it? Julian. On Fri, 18 May 2007 16:25:03 +0900 Chris Dew wrote: > As far as I can see, the 'end' keyword is 'repeating yourself' when > used with properly indented code. > > class Foo > > def bar(value) > if value < 7 > puts "hello" > else > puts "world" > end > end > > def foobar > puts "foobar" > end > > end > > could be > > class Foo > > def bar(value) > if value < 7 > puts "hello" > else > puts "world" > > def foobar > puts "foobar" > > with no reduction in meaning, yet 25% fewer lines of code. > > > What are the reasons why this isn't used/implemented/liked? It would > be a small change to the interpreter. Enabling meaningful indentation > would only make 'end' optional, not invalid; backwards compatibility > wouldn't be a problem. > > (I use both Ruby and Python. I think indentation is one of the few > *language* features where Python leads Ruby.) > > If this post generates a positive response, I'll make a patch for Ruby > 1.9. > >