Prior to .NET 2.0, there wasn't the facility in C# to opt the visibility level for the get and set property or indexers. And i take my comment in my previous post that C# does not provide the facility of having different visibility levels for the get and set accessors. While that is partly correct, it is no more in C# 2.0. And obviously it isn't in the easy and elegant way. Take a look at this code snippet:- public bool LogToStdError { get { return _log2StdError; } protected set { _log2StdError = value; } } I do not have to explain the code except there are some restrictions while having different visibility levels for the get/set accessors of a property. 1. You can provide an explicit visibility either for get or set. Hence the following code will throw an error:- public bool LogToStdError { protected get { return _log2StdError; } protected set { _log2StdError = value; } } 2. The visibility thus explicitly specified must be a sub...
Another effective [debugging] technique is to explain your code to someone else. This will often cause you to explain the bug to yourself. Sometimes it takes no more than a few sentences, followed by an embarrassed "Never mind. I see what's wrong. Sorry to bother you." This works remarkbly well; you can even use non-programmers as listeners. - From "The Practice of Programming" by Brian W Kernighan & Rob Pike.