Data structures that strongly require to be thread-safe are best candidates to become immutable objects. Moreover, as programmers can write mutable code that behaves in an immutable fashion, how to best achieve immutability? Does this programming approach really affect performance?
Immutability means that variables cannot be modified once they have been set with data, which prevents unwanted changes from occurring.
The concept of immutability is strictly connected with pure functions. In pure functions: