From: Chad Perrin Date: 2007-05-23T07:12:11+09:00 Subject: Re: How to adopt "Python Style" indentation for Ruby On Wed, May 23, 2007 at 12:27:21AM +0900, Rick DeNatale wrote: > > And with the judicious use of {} vs. do end there are other > alternatives which may suit individual tastes depending on how tightly > you like to see the code: > > table do > @components.each do |row| > tr do > row.each do |col| > td {pre {text col} > end > end > end > end > > or the ultra tight: > > table {@components.each {|row| tr {row.each {|col| td {pre {text col}}}}} > > or if you aren't religious about reserving brackets for one-line > blocks (I'm not): > > table { > @components.each { |row| > tr { > row.each { |col| > td {pre {text col} > } > } > } > } > > Or anywhere in-between. For the sake of readability, I'd probably lean more toward: table do @components.each do |row| tr do row.each {|col| td { pre { text col } } } end end end . . . or something like that. Up to three layers of any one type of delimiter and up to sixty characters or so width seem to be fine for parsing by eye, and splitting brace-delimited lines over several lines in Ruby just looks wrong somehow. Maybe that's just me, though. -- CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] MacUser, Nov. 1990: "There comes a time in the history of any project when it becomes necessary to shoot the engineers and begin production."