I was reading though a question about impure methods on StackOverflow here and it got me thinking about struct design best practise.
Reading an example about creating an immutable struct here properties are defined as with getters only.
public DateTime Start { get { return start; } }
public DateTime End { get { return end; } }
public bool HasValue { get { return hasValue; } }
Other examples elsewhere including in System.Drawing.Point
the properties have getters and setters.
public int Y {
get {
return y;
}
set {
y = value;
}
}
The design guidelines don't specify but they are quite terse. What would be the recommended approach for struct properties? Readonly or allow writing?