One reason I've seen people avoid using properties is because they don't want the debugger to eagerly auto-expand it. For example, the property may involve allocating a large object, or calling a p/invoke but may not actually have any observable side-effects.
You can prevent the debugger from auto-expanding properties such as above, by using the DebuggerBrowsableAttribute.
The following example shows this attribute being applied to an instance property.
[C#]
using System;
using System.Diagnostics;
namespace Microsoft.Samples
{
public class Foo
{
[...]
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
public LargeObject LargeObject
{
get
{
// Allocate large object
[...]
}
}
}
}
[Visual Basic]
Imports System
Imports System.Diagnostics
Namespace Microsoft.Samples
Public Class Foo
[...]
<DebuggerBrowsable(DebuggerBrowsableState.Never)> _
Public ReadOnly Property LargeObject() As LargeObject
Get
' Allocate large object
[...]
End Get
End Property
End Class
End Namespace
For more information, see http://msdn2.microsoft.com/en-us/library/ms228992.aspx .