bbatsov/ruby-style-guide — pull request #61 by eremite (2011-10-17 23:05:39+00:00)
Title: Empty lines before return values?

I did some searching but couldn't find any discussion of the rationale behind this rule. It appears to me that it was carried over from style guides from other languages like C or Java. When dealing with long functions that may or may not return values I can imagine it might be useful to use whitespace to accentuate returns. But this is ruby! We don't need [explicit returns](https://github.com/bbatsov/ruby-style-guide/issues/9) and "most methods will be shorter than 5 LOC". In my opinion, the extra blank lines are redundant and make it harder to scan the code for logical chunks.

I didn't come up with a clever regex to check usage in the wild but I did browse through the code for "Programming Ruby 1.9" as well as Rails and Sinatra and no one appeared to be adding the extra lines. Longer methods were broken into paragraphs which sometimes left the return value lonely, but not necessarily. I propose dropping the specific rule in favor of the more generic practice of using empty lines to delineate logical groupings.