Obviously, the immutable version has a memory and a performance overhead. However, when we work with the concurrent code, it makes sense to pay for the extra overhead to avoid potential issues caused by mutable objects.
- Understanding the difference between mutability and immutability
- from Learning Object-Oriented Programming
- Publisher: Packt Publishing
- Released: July 2015
Pros and cons of immutable objects.
Share this highlighthttp://www.safaribooksonline.com/a/learning-object-oriented-programming/568052/