When should we use immutable data structures?
When should we use immutable data structures?
2 Replies
Are there specific situations where we would need to avoid defensive copying?
I'll chime in here a bit late to mention that immutability can help you reason about your code a lot easier. Keeping track of mutable state can be very difficult and annoying, and immutable data structures can assist in remedying that.