[phobos] excessive vertical spacing?
Brad Roberts
braddr at puremagic.com
Mon Jan 28 06:46:32 PST 2013
On 1/27/2013 12:11 PM, Andrei Alexandrescu wrote:
> There's been sporadic discussion every now and then about recommended style etc. Time to add to it :o).
>
> I've noticed excessive empty lines in a few Phobos modules. For example:
>
> @property SysTime timeLastModified()
> {
> _ensureStatDone();
>
> return SysTime(unixTimeToStdTime(_statBuf.st_mtime));
> }
>
> And so on for functions of 2-5 lines, and there's a bunch of them. It would be difficult to argue that the vertical
> space adds to clarity as the whole thing is just there.
>
> Can we agree to be a bit more sparing with empty lines? If there's one resource that's not abundant to all of us, that
> must be vertical space.
>
>
> Thanks,
>
> Andrei
I actually prefer the blank line. For me, blank lines separate logically separate parts of code. If a set of lines
have no separating vertical white space it indicates that they're directly related. In a two line example like this, it
matters a little less, but it does still matter.
If functions are so long that they can't be displayed as a whole, it's not the vertical white space that's at issue,
it's the amount of code as a whole.. time to split up.
I acknowledge that a lot of this boils down to style and screen and font sizes. My typical editor session is about 120
cols, 80 rows, two side by side on a 24" monitor. Occasionally another pair of those on the second monitor (though
that's usually browser + mail client).
So, no, I don't agree, but not passionately.
My 2 cents,
Brad
More information about the phobos
mailing list