Tuesday, April 03, 2007

Simple properties

What do you prefer?

1)

private int m_foo;
public int Foo
{
get { return m_foo; }
set { m_foo = value; }
}

2)
public int Foo { get; set; }

3)
public:
property
int Foo;


The first is C#, the second C# 3.0 and the third one is C++/CLI

No comments: