From: "Iñaki Baz Castillo" Date: 2010-01-10T05:10:35+09:00 Subject: Re: Ruby editing style rules and recommendation? El Sábado, 9 de Enero de 2010, Nathan Oyama escribió: > In the previous thread, Fleck wrote: > > 0.step(0.5,0.1) { |i| p i } > > while Aaron wrote: > > (0..0.5).step(0.1) do |f| > p f > end > > and both work identically. > > Which one is recommended in terms of the editing style? Imho using { } for inline code and do..end for a multiline block of code. This is: Correct: array.each do |entry| lalala = entry.name lololo = entry. time end Correct: array.each { |entry| lalala = entry.name } "Incorrect": array.each { |entry| lalala = entry.name lololo = entry. time } "Incorrect": array.each do |entry| lalala = entry.name ; end -- Iñaki Baz Castillo