Immutable data structures are facts that can be compared and reasoned about. Mutable things are error-prone buckets. You should never use a mutable data structure unless you're able to defend it and there are really, really few places in which a mutable data structure is defensible.
So there you have it - a public API exposing a mutable data-structure is an abomination of nature, leading to problems that can be worse than what happens when doing manual memory management
Login in to like
Login in to comment