Answer the question
In order to leave comments, you need to log in
Which is better to write property?
What is the correct way to write property? Completely private or short?
Answer the question
In order to leave comments, you need to log in
If the property one-to-one corresponds to the storage field, then it can be short, just remember to set the access correctly (it can be done separately for get and set). If several properties are taken from one field at once, then you have no choice).
It is also convenient to use a private field if the property has lazy initialization.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question