Andrei Dascalu
1 min readAug 12, 2020

--

You are talking about very different things.

Immutability is a property of data, to remain as is once declared and any required changes should result in mutated copies. Unless there is a language feature to this regard, enforcement is a matter of convention.

Functions are, ideally, idempotent. AKA when provided the same input will always result in same output without anything else being altered. This requires data to be immutable, convention or not. If functions are not idempotent, there is no FP. But since even in FP there are cases when side effects are needed (AKA API calls or db load/save) then immutability cannot be guaranteed (unless, as mentioned, there are some language features, otherwise you are in the same boat as DDD in OOP.

--

--