Re: Notes on the Phobos style guide

2010-08-17 Thread Kagamin
bearophile Wrote: * In D, use of auto is recommended unless you want to make a specific point by mentioning the type. On the other hand code needs to be read too, sometimes by people that have not written it. In this case seeing the actual types used is often better. So using auto

Re: Notes on the Phobos style guide

2010-08-17 Thread dsimcha
== Quote from Kagamin (s...@here.lot)'s article bearophile Wrote: * In D, use of auto is recommended unless you want to make a specific point by mentioning the type. On the other hand code needs to be read too, sometimes by people that have not written it. In this case seeing the

Notes on the Phobos style guide

2010-08-16 Thread bearophile
Few comments of mine about this, written by Andrei: http://lists.puremagic.com/pipermail/phobos/2010-August/001757.html * Generally the prevalent Phobos (and I hope D) style is to declare local values as late as possible. Good. Defining variables at the top of the function/method is positive

Re: Notes on the Phobos style guide

2010-08-16 Thread Andrei Alexandrescu
bearophile wrote: Few comments of mine about this, written by Andrei: http://lists.puremagic.com/pipermail/phobos/2010-August/001757.html * Generally the prevalent Phobos (and I hope D) style is to declare local values as late as possible. Good. Defining variables at the top of the

Re: Notes on the Phobos style guide

2010-08-16 Thread Jonathan M Davis
This is, unfortunately, the sort of thing that can get pretty opinionated, and there are plenty of people who hate having to write code in any style other than their own, but unfortunately, you do sometimes need at least some sort of stylistic guidelines or things can become a mess. On

Re: Notes on the Phobos style guide

2010-08-16 Thread bearophile
Andrei Alexandrescu: [citation needed] A cursory googling didn't find many discussions. The people that have designed C++0x are surely smart and expert, but they have done some mistakes: - the lambda is WAY over-engineered; - and the R-value references are useful but they look too much hard

Re: Notes on the Phobos style guide

2010-08-16 Thread Adam Ruppe
On 8/16/10, bearophile bearophileh...@lycos.com wrote: 'auto' in C++0x is a good and useful feature, just as it is useful in D, but as I have explained it has real risks, so it must be used with moderation, if you use it everywhere in the code, your code becomes harder to understand and

Re: Notes on the Phobos style guide

2010-08-16 Thread Jonathan M Davis
On Monday, August 16, 2010 15:59:14 bearophile wrote: Jonathan M Davis: Obviously, in my own code, I'm just going to code the way that I like, and I see no point in any kind of standard D style guide with regards to braces and other visual elements to relate primarily to how the code

Re: Notes on the Phobos style guide

2010-08-16 Thread bearophile
Jonathan M Davis: I see little no value in trying to enforce any kind of coding standard on the D community as a whole, If your program is partially composed by several modules written by different programmers, that you have found on the net (like from dsource), you will not appreciate to

Re: Notes on the Phobos style guide

2010-08-16 Thread bearophile
If you don't see the advantage of this for your D/Python programs then maybe it's because you haven't done this yet :-) Sorry, my manners need to be improved. bearophile

Re: Notes on the Phobos style guide

2010-08-16 Thread Andrej Mitrovic
I think Jonathan was talking about the entire community, not a single project. It's impossible for all people to accept a unified standard, everyone has their own style and they'll most probably keep it that way. What matters is consistency. So if you have a certain way of coding, be consistent

Re: Notes on the Phobos style guide

2010-08-16 Thread Brad Roberts
On Mon, 16 Aug 2010, Walter Bright wrote: Jonathan M Davis wrote: Obviously, in my own code, I'm just going to code the way that I like, and I see no point in any kind of standard D style guide with regards to braces and other visual elements to relate primarily to how the code looks