From: Josh Cheek Date: 2010-01-10T18:27:54+09:00 Subject: Re: Ruby editing style rules and recommendation? --001636b2ad06e44d53047ccc082a Content-Type: text/plain; charset=ISO-8859-1 On Sat, Jan 9, 2010 at 8:34 PM, Marnen Laibow-Koser wrote: > > I've also started alternating them to make it clearer where blocks start > > and > > end. > > > > def whatever > > each { |obj| > > if obj < MID > > call_method > > else > > self.var = yield obj > > call_other_method > > end > > } > > end > > Yuck! That looks inconsistent to me. It would also be an editing > nightmare if you extract or introduce one level of nesting. > It's not mandatory, it's mostly just whether they can be lined up easily. Meaning I would do it if I were having difficulty reading it, so at that point it can be expected to save me time. If the level of nesting changes, that doesn't translate into a change between braces and do/end, only if the introduction makes it difficult to read (meaning they alternate based on readability rather than every other level of nesting). --001636b2ad06e44d53047ccc082a--