Re: @property get/set or public varaible?

2016-12-05 Thread ArturG via Digitalmars-d-learn
On Sunday, 4 December 2016 at 20:44:05 UTC, Jonathan M Davis wrote: On Sunday, December 04, 2016 15:30:22 vladdeSV via Digitalmars-d-learn wrote: Hello! I have a question not directly related to D as it is with coding standards. My issue at hand is if I have one variable for a class, which

Re: @property get/set or public varaible?

2016-12-04 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, December 04, 2016 15:30:22 vladdeSV via Digitalmars-d-learn wrote: > Hello! > > I have a question not directly related to D as it is with coding > standards. > > My issue at hand is if I have one variable for a class, which I > want to be directly accessible for anything else, should

Re: @property get/set or public varaible?

2016-12-04 Thread ketmar via Digitalmars-d-learn
On Sunday, 4 December 2016 at 15:30:22 UTC, vladdeSV wrote: Are there any other reasons to use get/setters? basically, no. as you can omit parentheses in D, converting to getter/setter later should be seamless. the only reason to have getter/setter in your case is a situation where you may

Re: @property get/set or public varaible?

2016-12-04 Thread angel via Digitalmars-d-learn
On Sunday, 4 December 2016 at 15:30:22 UTC, vladdeSV wrote: Hello! I have a question not directly related to D as it is with coding standards. My issue at hand is if I have one variable for a class, which I want to be directly accessible for anything else, should it be 1. public, or 2.

@property get/set or public varaible?

2016-12-04 Thread vladdeSV via Digitalmars-d-learn
Hello! I have a question not directly related to D as it is with coding standards. My issue at hand is if I have one variable for a class, which I want to be directly accessible for anything else, should it be 1. public, or 2. private, with @property get/setters? From what I have been