I\'ve read a couple of articles on immutability but still don\'t follow the concept very well.
I made a thread on here recently which mentioned immutability, but as
"... why should I worry about it?"
A practical example is repetitive concatenation of strings. In .NET for example:
string SlowStringAppend(string [] files)
{
// Declare an string
string result="";
for (int i=0;i
Unfortunately using the first (slow) function approach is still commonly used. An understanding of immutability makes it very clear why using StringBuilder is so important.