On Wednesday, August 10, 2011 21:42:01 Marco Leise wrote: > Am 10.08.2011, 19:24 Uhr, schrieb Adam D. Ruppe > > <destructiona...@gmail.com>: > > bearophile: > > > > The thing is just because you call it a problem a lot doesn't mean > > everyone else sees it that way. > > > > A lot of us have many years of experience and just don't see it the > > same way you do. > > I think a blank line makes code easier on the eyes. When you scroll over > it you recognize easily where you are from the size and shape of the > paragraphs. So I totally understand that. On the other hand my laptop > screen is 1280x800 and I also feel that sometimes I think I scroll over > the end of a function body when there is just a blank line in a block of > code. So usually I go with the approach of inserting a comment line > instead of a blank line, which is usually italic and in a brighter color. > If I was working on a Phobos module I would try to mime existing code > style (and probably find out that there is no common style :p ). Anyway > such things can be up to a vote just like the idea to not use single > capital letters only for template type placeholders (i.e. T, S). > Google's code style wiki is nice. It lists all the rules and also offers > an explanation. We can have that for Phobos, too. So topics like these > don't come up over and over again. The D style guide is a good start: > http://www.digitalmars.com/d/2.0/dstyle.html
This sort of thing has been discussed by the Phobos dev team previously, and the general consensus was not to enforce much in the way of formatting in a style guide. There a few things that were agreed upon (such as always putting braces on their own line), but on the whole, the style guide is supposed to focus on the API (so, things like function and variable names) rather than how code is formatted. I have an update to the style guide as a pull request which is currently being reviewed to make sure that the style guide on the site is in line with what we do: https://github.com/D-Programming-Language/d-programming-language.org/pull/16 But I'm certain that you're not going to get the Phobos devs to agree on a style guide like Bearophile wants. And honestly, I'm a bit tired of the topic coming up. The does need some updates, but it's mostly correct. It's essentially what we've decided on, and I don't see any reason to keep discussing it over and over. Personally, I'd prefer that Dmitry had more blank lines in his code, but it's up to him how he does that as long as his code falls within the rules set down by the D style guide. And for any of his code which isn't going into Phobos, it's completely up to him how to format it. - Jonathan M Davis