+ 1
What are the conventions for writing a properties
When should I use automatic generated and when the long ones.
4 odpowiedzi
+ 2
A convention is a contract with yourself, the company or the group you are in.
Yes it is right to do it in the get/set. However, I usally check nu input before assigning it to the properties.
So most of the time I do it, when the user leaves the control (Read textbox) or when ok-button is pressed.
+ 1
I always start with a automatically generated. If I need to write code in the get/set, I do that afterwards.
Private variables of the properties are always lower case
For Public variables I use camel case
+ 1
sneeze Is it right to make the validation in the property ? Or where else could be done right if we follow the conventions ?
+ 1
Thanks