From: Nobuyoshi Nakada Date: 2008-10-07T18:14:45+09:00 Subject: Re: Why not adopt "Python Style" indentation for Ruby? Hi, At Tue, 7 Oct 2008 04:57:45 +0900, Brian Candler wrote in [ruby-talk:317027]: > I find Ruby's syntax as-is works remarkably well. The only problem it > causes me is with do-end mismatches where the parser just runs off the > end of the file, with no indication of where the missing do or end might > be. I have on many occasions resorted to chopping a copy of my source > file to find the problem (that is, lopping out a class or a method at a > time until the problem goes away) Python style indentation also can't help you alone. How can it know which did you intend? if x == "ok": print "ok" print "foo" if x == "ok": print "ok" print "foo" > Personally, the solution I would love to have is a parser/pretty-printer > tool which can read a Ruby source file and spit it back out with > "standardised" indentation. It would then be obvious where the problem > lies. You'd get the benefit of python-style indentation, without > actually having to use python-style indentation :-) Recent 1.9 warns when it see a mismatch. $ ./ruby -ve 'begin end' ruby 1.9.0 (2008-10-07 revision 19704) [i686-linux] ./ruby: warning: mismatched indentations: line 1:'begin' and line 2:'end' -- Nobu Nakada