DStyle: Braces on same line
Joseph Rushton Wakeling via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Jul 13 10:56:40 PDT 2014
On 13/07/14 19:24, Timon Gehr via Digitalmars-d-learn wrote:
> Wrong. There are things which are simply bad ideas.
I think that we can take it as read that I meant, "Any reasonable stylistic
choice." Of course, YMMV about what counts as "reasonable", but most of the
things that people fuss over are fairly minimal differences in practice.
> I.e. you see where everything is.
Compactness can also be a disadvantage. Some people have a preference for a
hyper-compact style where there are minimal blank lines in the code; I accept
their goal as valid, and I think there are cases where it can surely help, but
it's not one that I personally find very helpful.
In fact, one reason that I've come to appreciate standard D style is the way in
which separate opening braces actually help to space out the code into more
obvious "paragraphs".
> This is the only argument I have heard in favour of doing this, but it is not
> actually valid. This critique might apply to Lisp style.
Well, I personally find that separate-line opening braces do make it easier to
line up the opening and ending of scopes. If it doesn't do anything for you,
that's a shame; but it doesn't make the argument invalid.
More information about the Digitalmars-d-learn
mailing list