[phobos] excessive vertical spacing?

Jacob Carlborg doob at me.com
Mon Jan 28 12:26:17 PST 2013


On 28 jan 2013, at 21:04, Jonathan M Davis <jmdavisProg at gmx.com> wrote:

> On Monday, January 28, 2013 10:50:10 Andrei Alexandrescu wrote:
>> On 1/28/13 9:46 AM, Brad Roberts wrote:
>>> I actually prefer the blank line.
>> 
>> I'm surprised, but it's a good lesson to learn. I honestly believed
>> nobody would prefer that.
> 
> I pretty much always put a blank line before return statements precisely so 
> that they're visibly separate from the rest of the code. It's the same reason
> why I pretty much always have a blank line after vairable declarations or
> before or after if blocks or loops. It's less of a big deal in this
> particular case, because there's only one line of code above it, but I pretty 
> much agree with Brad's reasoning on this. Blank lines are good for logically
> separating out sections of code, and I use them for that quite a bit.


I agree. I always put a blank line between expressions and statements:

int a = 3;
int b = 4 + b;

foreach (i ; a .. b)
{
}

b = 3;

-- 
/Jacob Carlborg



More information about the phobos mailing list