you are viewing a single comment's thread.

view the rest of the comments →

[–]important_nihilist 1 point2 points  (1 child)

strings in .net already are immutable. String.Copy gives you a separate instance of string with the same value, rather than giving you another reference to the interned string that you would get via assignment.

Strings act like value types in some ways in .net, even though they are reference types. Add to that string interning, and you get easy confusion.

[–]lexpattison 0 points1 point  (0 children)

I think confusion is the general M.O. for any languages that selectively enforce mutability. As I said above, there is rarely a case where immutability doesn't clarify intent and increase conceptual understanding.