Saturday, January 28, 2023

book: Data-Oriented Programming

the book is based on principles of Clojure prog. language,
that has unique and advance way of handling data

and apparently TypeScript also supports concepts of "Data Oriented" programming

Data-Oriented Programming

Eliminate the unavoidable complexity of object-oriented designs. The innovative data-oriented programming paradigm makes your systems less complex by making it simpler to access and manipulate data.
  • Separate code from data
  • Represent data with generic data structures
  • Manipulate data with general-purpose functions
  • Manage state without mutating data
  • Control concurrency in highly scalable systems
  • Write data-oriented unit tests
  • Specify the shape of your data
  • Benefit from polymorphism without objects
  • Debug programs without a debugger
the paradigm is language-agnostic: DOP code that can be implemented in JavaScript, Ruby, Python, Clojure, and also in traditional OO languages like Java or C#.


podcast interview with the book author;

The principles of data-oriented programming with Yehonathan Sharvit (The Changelog #522) |> Changelog


In DOP, data is treated as a first-class citizen.

The essence of DOP is that it treats data as a first-class citizen. It gives developers the ability to manipulate data inside a program with the same simplicity as they manipulate numbers or strings. Treating data as a first-class citizen is made possible by adhering to four core principles:

Principle #1: Separating code (behavior) from data.

Principle #2: Representing data with generic data structures.

Principle #3: Treating data as immutable.

Principle #4: Separating data schema from data representation.











No comments: