Re: DStyle: Braces on same line

2014-07-14 Thread Danyal Zia via Digitalmars-d-learn
On Sunday, 13 July 2014 at 16:10:31 UTC, Gary Willoughby wrote: Here is the 'official' style that is followed by most people including me. http://dlang.org/dstyle.html Unrelated to my original question. I already read that before asking.

Re: DStyle: Braces on same line

2014-07-14 Thread Dicebot via Digitalmars-d-learn
On Sunday, 13 July 2014 at 17:24:40 UTC, Timon Gehr wrote: but separate-line opening braces definitely make it easier to see where scopes begin and end. 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. It

Re: DStyle: Braces on same line

2014-07-13 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
On 12/07/14 21:01, Danyal Zia via Digitalmars-d-learn wrote: I noticed that in Andrei's talks and his book, he used braces on the same line of delcaration, however Phobos and other D libraries I know use braces on their own line. Now I'm in a position where I need to take decision on coding

Re: DStyle: Braces on same line

2014-07-13 Thread Danyal Zia via Digitalmars-d-learn
On Sunday, 13 July 2014 at 10:18:23 UTC, Joseph Rushton Wakeling via Digitalmars-d-learn wrote: However, I do think there's value in deliberately matching the code style of the standard library, as it extends the volume of public D code with a common style. So unless you have a strong personal

Re: DStyle: Braces on same line

2014-07-13 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, Jul 13, 2014 at 11:32:23AM +0200, Joseph Rushton Wakeling via Digitalmars-d-learn wrote: On 12/07/14 21:01, Danyal Zia via Digitalmars-d-learn wrote: I noticed that in Andrei's talks and his book, he used braces on the same line of delcaration, however Phobos and other D libraries I

Re: DStyle: Braces on same line

2014-07-13 Thread Gary Willoughby via Digitalmars-d-learn
On Saturday, 12 July 2014 at 19:01:56 UTC, Danyal Zia wrote: Hi, I noticed that in Andrei's talks and his book, he used braces on the same line of delcaration, however Phobos and other D libraries I know use braces on their own line. Now I'm in a position where I need to take decision on

Re: DStyle: Braces on same line

2014-07-13 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
On 13/07/14 16:52, H. S. Teoh via Digitalmars-d-learn wrote: I had my own style before, but after I started contributing to Phobos, I found it a pain to keep switching back and forth between styles (and to convert styles before submitting PR's), so eventually I decided to just adopt Phobos style

Re: DStyle: Braces on same line

2014-07-13 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
On 13/07/14 14:23, Danyal Zia via Digitalmars-d-learn wrote: I'm going with Andrei's style of preference on his talks ;) Andrei can no doubt speak for himself about his preferences, but I'd be wary of assuming that the style he uses in his talks necessarily reflects his actual stylistic

Re: DStyle: Braces on same line

2014-07-13 Thread Dicebot via Digitalmars-d-learn
On Sunday, 13 July 2014 at 16:47:00 UTC, Joseph Rushton Wakeling via Digitalmars-d-learn wrote: On 13/07/14 14:23, Danyal Zia via Digitalmars-d-learn wrote: I'm going with Andrei's style of preference on his talks ;) Andrei can no doubt speak for himself about his preferences, but I'd be

Re: DStyle: Braces on same line

2014-07-13 Thread bearophile via Digitalmars-d-learn
Danyal Zia: I noticed that in Andrei's talks and his book, he used braces on the same line of delcaration, however Phobos and other D libraries I know use braces on their own line. Rosettacode D examples always use the Egyptian style. For my code I use the same style, but Phobos

Re: DStyle: Braces on same line

2014-07-13 Thread Timon Gehr via Digitalmars-d-learn
On 07/13/2014 06:45 PM, Joseph Rushton Wakeling via Digitalmars-d-learn wrote: Two consequences of adapting myself to Phobos style were that I realized (i)how little most of these things really matter, and (ii) pretty much any stylistic choice carries both benefits and drawbacks. ... Wrong.

Re: DStyle: Braces on same line

2014-07-13 Thread Brian Rogoff via Digitalmars-d-learn
On Sunday, 13 July 2014 at 17:24:40 UTC, Timon Gehr wrote: On 07/13/2014 06:45 PM, Joseph Rushton Wakeling via Digitalmars-d-learn wrote: Wrong. There are things which are simply bad ideas. E.g. in this case, Egyptian-style braces definitely make your code more compact, I.e. you see where

Re: DStyle: Braces on same line

2014-07-13 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
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

Re: DStyle: Braces on same line

2014-07-13 Thread Timon Gehr via Digitalmars-d-learn
On 07/13/2014 07:51 PM, Brian Rogoff wrote: On Sunday, 13 July 2014 at 17:24:40 UTC, Timon Gehr wrote: On 07/13/2014 06:45 PM, Joseph Rushton Wakeling via Digitalmars-d-learn wrote: Wrong. There are things which are simply bad ideas. E.g. in this case, Egyptian-style braces definitely make

Re: DStyle: Braces on same line

2014-07-13 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
On 13/07/14 19:51, Brian Rogoff via Digitalmars-d-learn wrote: Yes, the same argument for books and slides is also applicable to all other media. Not really. In a book or a slide you have an unavoidable constraint on how much vertical space you can take up. On a screen, you are unavoidably

DStyle: Braces on same line

2014-07-12 Thread Danyal Zia via Digitalmars-d-learn
Hi, I noticed that in Andrei's talks and his book, he used braces on the same line of delcaration, however Phobos and other D libraries I know use braces on their own line. Now I'm in a position where I need to take decision on coding style of my library and I get accustomed to use braces on

Re: DStyle: Braces on same line

2014-07-12 Thread Dicebot via Digitalmars-d-learn
On Saturday, 12 July 2014 at 19:01:56 UTC, Danyal Zia wrote: Should I worry about it? Or is that's just a debatable style that won't really matter if it's persistent throughout library? Depends entirely on whenever you want to match style of standard library - no one will blame you for having

Re: DStyle: Braces on same line

2014-07-12 Thread anonymous via Digitalmars-d-learn
On Saturday, 12 July 2014 at 19:01:56 UTC, Danyal Zia wrote: Hi, I noticed that in Andrei's talks and his book, he used braces on the same line of delcaration, however Phobos and other D libraries I know use braces on their own line. Now I'm in a position where I need to take decision on

Re: DStyle: Braces on same line

2014-07-12 Thread Danyal Zia via Digitalmars-d-learn
On Saturday, 12 July 2014 at 19:35:11 UTC, anonymous wrote: There is another stylistic choice which I do find confusing: capitalized identifiers for non-types, e.g. variables and functions. Please don't do that. Agreed about variables and functions. However I personally prefer to use

Re: DStyle: Braces on same line

2014-07-12 Thread dysmondad via Digitalmars-d-learn
On Saturday, 12 July 2014 at 19:01:56 UTC, Danyal Zia wrote: Hi, I noticed that in Andrei's talks and his book, he used braces on the same line of delcaration, however Phobos and other D libraries I know use braces on their own line. Now I'm in a position where I need to take decision on