I frequently read that structs should be immutable - aren\'t they by definition?
Do you consider int to be immutable?
int i
I don't want to complicate reasoning about this by considering
refparameters and boxing. I am also aware thatp = p.Offset(3, 4);expresses immutability much better thanp.Offset(3, 4);does. But the question remains - aren't value types immutable by definition?
Well, then you're not really operating in the real world, are you? In practice, the propensity of value types to make copies of themselves as they move between functions meshes well with immutability, but they aren't actually immutable unless you make them immutable, since, as you pointed out, you can use references to them just like anything else.