Please help settle this argument. I have a public class with some properties. The set of the properties is private and get is public. The only way to set a property is to call the constructor. What are the benefits or drawbacks of this design? Is there any implications I should know of? My argument is if there's no benefit to private set why do it? The counter argument is there's not need to change the property after class is instantiated if the need arises modify the class to allow it.
Is this just philosophical or is there actual technical reasoning behind this?
public string Id
{
get;
private set;
}
UPDATE: Just to clarify the question. I'm not asking what private set is for and where to use it. I'm asking if you don't know if your properties will need to be changed outside of the constructor or not do you get a benefit from restricting the set. So I guess the question is if you don't know which way you're going is the answer keep it as restrictive as possible?