Tagged with properties
An advantage of C# properties
Just found a good reason to use properties in C# rather than public variables: they’re much easier to debug. When I was getting an unexpected value in the variable, I put a break point in the property and was able to really easily find out where it was being set.Published in .NET on Thursday, November 4th, 2004
StackOverflowException and properties
An easy way to get this exception is by refering a property to itself: public string myproperty { set { myproperty = value; } } The exception looks like this: [StackOverflowException: Exception of type System.StackOverflowException was thrown.] Granted it’s a pretty dumb thing to do.. :)Published in ASP.NET on Monday, October 18th, 2004






