Hello, For simplicity, if it's only setting a variable and not doing something else, I'd use the first case:
public string MyProperty
{
get { return myProperty; }
set { myProperty = value; }
}
If setting the property implies other operations, then, depending on them, I would check the previous value. For example, if when a property is set to false I need to remove an event handler, I would check before that the property was not already false, so I don't remove the handler twice. But for simple properties that only set variables, no need to check. -- LuisR
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005