# Data is immutable

DevFeed: [Data is immutable](<https://devfeed.tech/articles/data-is-immutable-37568.md>)

Original publisher: [Read original article](<https://blog.klipse.tech/databook/2022/06/22/immutable-data.html>)

Author: Yehonathan Sharvit

Published: 2022-06-22T02:34:24Z

Content type: article

Language: en

Sources: [Klipse](<https://devfeed.tech/sources/klipse.md>)

Topics: [data](<https://devfeed.tech/topics/data.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>), [Clojure](<https://devfeed.tech/topics/clojure.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>)

Tags: [clojure](<https://devfeed.tech/tags/clojure.md>), [d](<https://devfeed.tech/tags/d.md>), [data](<https://devfeed.tech/tags/data.md>), [dop](<https://devfeed.tech/tags/dop.md>), [immutability](<https://devfeed.tech/tags/immutability.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [mutation](<https://devfeed.tech/tags/mutation.md>)

## AI overview

This article explains the third principle of Data-Oriented Programming: data is immutable. It describes replacing mutation with new data versions, contrasts this approach in Clojure and JavaScript, and discusses cloning and persistent data structures as implementation strategies.

## Source excerpt

With data separated from code and represented with generic data structures, how are changes to the data managed? DOP is very strict on this question. Mutation of data is not allowed! In DOP, changes to data are accomplished by creating new versions of the data. The reference to a variable may be changed so that it refers to a new version of the data, but the value of the data itself must never change.