From: Ron Jeffries Date: 2002-03-20T09:01:10+09:00 Subject: Re: style choice On Tue, 19 Mar 2002 08:16:01 -0500, Ron Jeffries wrote: >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 And the winner seems to be an unlisted alternative with the if/end, by a fairly wide margin. Thanks! Ronald E Jeffries http://www.XProgramming.com http://www.objectmentor.com I'm giving the best advice I have. You get to decide whether it's true for you.