Whenever I tell Visual Studio to create getters
and setters
it generates the following code:
private string name;
public string Name
{
get { return name; }
set { test = value; }
}
This code is not easy for me to understand. What would be much easier to work with, for me, would be the following:
public string GetName()
{
return name;
}
public void SetName(string _name)
{
name = _name;
}
I'd like to know if it is bad practice to write my own functions for get
/set
.