I have seen several naming conventions used for fields in C#. They are:
Underscore
public class Foo
{
private string _name;
public string Name
{
get { return _name; }
set { _name = value; }
}
}
This
public class Foo
{
private string name;
public string Name
{
get { return this.name; }
set { this.name = value; }
}
}
Member Prefix
public class Foo
{
private string m_name;
public string Name
{
get { return m_name; }
set { m_name = value; }
}
}
Which do you prefer? Is there a different way you prefer to do it? Just curious to know what others feel is a best practice.