From: Christoph Date: 2002-03-19T23:19:57+09:00 Subject: Re: style choice "Ron Jeffries" wrote in .... > A style question for the community ... which of the following do you prefer, and > why? Or, if you prefer some third version, what is it and why? > > def degree > return @degree if @degree > 0 > @scopes.each { | field | @degree += field.length } > @degree > end > > def degree > @scopes.each { | field | @degree += field.length } if @degree == 0 > @degree > end Of the given choices I'd definitely go with the second - the explicit and implicit return of the first solution needlessly clutters (visually and logically) this simple snippet imho. /Christoph