Re: local variable naming convention

2013-12-20 Thread Jacob Carlborg
On 2013-12-20 10:15, Boyd wrote: I'm in the process of adapting my library to the D standard naming convention. The problem is that I used to separate member variables and local variables through capitalization. X would be a member variable. x would be a local variable. this allowed me, among

Re: local variable naming convention

2013-12-20 Thread Jacob Carlborg
On 2013-12-20 12:16, Boyd wrote: What does m_ stand for anyway? "member" I would guess. -- /Jacob Carlborg

Re: local variable naming convention

2013-12-20 Thread Gary Willoughby
On Friday, 20 December 2013 at 09:30:08 UTC, bearophile wrote: kdmult: this(int x, int y) { this.x = x; this.y = y; } In D I prefer: this(int x_, int y_) { this.x = x_; this.y = y_; } Bye, bearophile I tend to use the opposite for private/protected member variables as per the

Re: local variable naming convention

2013-12-20 Thread Boyd
On Friday, 20 December 2013 at 10:29:26 UTC, Jeremy DeHaan wrote: On Friday, 20 December 2013 at 10:06:36 UTC, Jonathan M Davis wrote: Whereas I put the underscore before (e.g. _x), and some folks like to do m_x (though I haven't seen many people do that in D - more in C++). I tend to use th

Re: local variable naming convention

2013-12-20 Thread Jeremy DeHaan
On Friday, 20 December 2013 at 10:06:36 UTC, Jonathan M Davis wrote: Whereas I put the underscore before (e.g. _x), and some folks like to do m_x (though I haven't seen many people do that in D - more in C++). I tend to use the m_x naming convention, though I limit it to private member varia

Re: local variable naming convention

2013-12-20 Thread Jonathan M Davis
On Friday, December 20, 2013 10:30:06 bearophile wrote: > kdmult: > > this(int x, int y) > > { > > > >this.x = x; > >this.y = y; > > > > } > > In D I prefer: > > this(int x_, int y_) { > this.x = x_; > this.y = y_; > } Whereas I put the underscore before (e.g. _x), and some f

Re: local variable naming convention

2013-12-20 Thread Boyd
On Friday, 20 December 2013 at 09:30:08 UTC, bearophile wrote: kdmult: this(int x, int y) { this.x = x; this.y = y; } In D I prefer: this(int x_, int y_) { this.x = x_; this.y = y_; } Bye, bearophile I concur. And I should probably get used to using 'this' a lot as well. Ma

Re: local variable naming convention

2013-12-20 Thread bearophile
kdmult: this(int x, int y) { this.x = x; this.y = y; } In D I prefer: this(int x_, int y_) { this.x = x_; this.y = y_; } Bye, bearophile

Re: local variable naming convention

2013-12-20 Thread kdmult
On Friday, 20 December 2013 at 09:15:26 UTC, Boyd wrote: this(int x, int y) { X = x; Y = y; } So now my question is, how do you distinguish between member and local vars in such cases? this(int x, int y) { this.x = x; this.y = y; }

local variable naming convention

2013-12-20 Thread Boyd
I'm in the process of adapting my library to the D standard naming convention. The problem is that I used to separate member variables and local variables through capitalization. X would be a member variable. x would be a local variable. this allowed me, among other things, to create constru