Top "Immutability" questions

Immutability is the inability to modify data after it has been created.

In Scala, difference between final val and val

In Scala, what is the difference between val a = 1 and final val fa = 1

scala immutability
What is the cleanest way to remove an element from an immutable array in JS?

I need to remove an element from an array that is a state of a React Component. Which means that …

javascript arrays reactjs immutability spread-syntax
Immutable Scala Map implementation that preserves insertion order

LinkedHashMap is used to preserve insertion order in the map, but this only works for mutable maps. Which is the …

scala dictionary collections immutability
Check for mutability in Python?

Consider this code: a = {...} # a is an dict with arbitrary contents b = a.copy() What role does mutability play in …

python python-3.x immutability python-2.x hashable
are user defined classes mutable

Say I want to create a class for car, tractor and boat. All these classes have an instance of engine …

python class immutability mutable
Does using public readonly fields for immutable structs work?

Is this a proper way to declare immutable structs? public struct Pair { public readonly int x; public readonly int y; // …

c# struct immutability
What's the best name for a non-mutating "add" method on an immutable collection?

Sorry for the waffly title - if I could come up with a concise title, I wouldn't have to ask …

language-agnostic naming-conventions list immutability
Why are python strings and tuples are made immutable?

I am not sure why strings and tuples were made to be immutable; what are the advantages and disadvantage of …

python string immutability tuples
What's the use of System.String.Copy in .NET?

I'm afraid that this is a very silly question, but I must be missing something. Why might one want to …

.net string copy immutability
Why shouldn't I use immutable POJOs instead of JavaBeans?

I have implemented a few Java applications now, only desktop applications so far. I prefer to use immutable objects for …

java immutability javabeans pojo