Design patterns·Functional ideas that went mainstream
nothing that was handed out can be changed, so you stopped copying defensively and stopped worrying about who else holds it.
Immutability
Also calledimmutable, immutable data
Building values that cannot change after construction, so a change produces a new value instead. It removes aliasing bugs, makes equality and hashing safe, makes objects shareable across threads without locks, and makes change detection a reference comparison. The costs are allocation and awkwardness in the places where a large structure genuinely does change often, which is what persistent data structures address.