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.











Javascript: The Good Parts vs "new parts"

 Javascript: The Good Parts : ProgrammerHumor

JS has many features, collected over time, some of them very good, making JS one of the most used, or THE most used prog. language... 

Still, the author of book  JavaScript: The Good Parts  Douglas Crockford (he also defined JSON!)
is not happy for many more new features being added


“The best thing we can do today to JavaScript is to retire it. Twenty years ago, I was one of the few advocates for JavaScript. Its cobbling together of nested functions and dynamic objects was brilliant. I spent a decade trying to correct its flaws. I had a minor success with ES5. But since then, there has been strong interest in further bloating the language instead of making it better. So JavaScript, like the other dinosaur languages, has become a barrier to progress. We should be focused on the next language..."














and here are both of authors together!