Prop Snippet Fail

This is one that belongs on failblog. I happen to be using Visual Studio 2005 at work, so the prop snippet generates a private member variable to encapsulate in a property. In this case, I needed the property "Value". Guess what happens?

        private string value;

        
public string Value
        {
            
get { return value; }
            
set { value = value; }
        }

Fail. The only thing that needs to be done to correct this is to qualify value in the setter. 

            set { this.value = value; }

There's no reason to make a better prop snippet now that it generates automatic properties in Visual Studio 2008. This problem merely amused me.

Print | posted on Tuesday, October 07, 2008 2:45 PM

Comments on this post

No comments posted yet.

Your comment:

 (will show your gravatar)
 
Please add 6 and 1 and type the answer here: