On Sunday, 12 March 2017 at 17:50:41 UTC, Stefan wrote:
On Sunday, 12 March 2017 at 10:47:35 UTC, Andrey wrote:
Hello, how better to declare properties, for example I have
class:
class Foo {
this(in int x, in int y, Bar bar) {
this.x = x;
this.y = y;
this.bar = bar;
On Sunday, 12 March 2017 at 10:47:35 UTC, Andrey wrote:
Hello, how better to declare properties, for example I have
class:
class Foo {
this(in int x, in int y, Bar bar) {
this.x = x;
this.y = y;
this.bar = bar;
}
private:
int x;
int y;
Bar bar;
}
On Sunday, 12 March 2017 at 11:15:04 UTC, Nicholas Wilson wrote:
You should only declare getters/setters if you need to (or
think you may need to later)
intercept the assignment or acquisition of a variable
(logging, computing on demand)
have a field as externally read only (setter
On Sunday, 12 March 2017 at 11:15:04 UTC, Nicholas Wilson wrote:
On Sunday, 12 March 2017 at 10:47:35 UTC, Andrey wrote:
And I want make access to read x, y and bar. Probably I should
add prefix for private members, that is a question: what
prefix should I use? Now I use prefix p_ (from the
On Sunday, 12 March 2017 at 10:47:35 UTC, Andrey wrote:
Hello, how better to declare properties, for example I have
class:
class Foo {
this(in int x, in int y, Bar bar) {
this.x = x;
this.y = y;
this.bar = bar;
}
private:
int x;
int y;
Bar bar;
}
And