23 Feb 2021
3 min read
Data Oriented Programming is an exciting new paradigm that eliminates the usual complexity caused by combining data and code into objects and classes. DOP cleanly separates code and data, which simplifies state management and eases concurrency.
We've asked Yehonathan Sharvit, the author of the book Data Oriented Programming to introduce us to the DOP principles and tell us why every developer should learn this programming paradigm.
Over the last couple of years, I have asked myself: what makes it so fun and productive for me in Clojure? At first, I thought it was the power of expression that Functional programming provides and the short feedback loop of the Clojure REPL. But I was wrong. In fact, what makes Clojure stand out is the fact that it puts data at the centre. By embracing Data-Oriented programming, Clojure reduces the complexity of the system.
In the book, I illustrate the principles of DOP and how each of them reduces the complexity of a software system, whether in the front end or in the back end, no matter what language the system is written in.
Data Oriented Programming (DOP) is a programming paradigm that makes the systems we build less complex. The cool thing is that DOP is language-agnostic: it is applicable to any programming language.
One could adhere to DOP principles (or break them) in:
The idea behind Data Oriented programming is to simplify the design and implementation of software systems by putting data at the centre. Instead of designing information systems around entities that combine data and code (e.g. objects instantiated from classes), DOP encourages us to separate code from data. Moreover, DOP provides guidelines about how to represent and manipulate data.
The essence of DOP is that it treats data as a first-class citizen. As a consequence, in Data Oriented programs, we manipulate data with the same simplicity as we manipulate numbers or strings in any other programs.
Treating data as a first-class citizen is made possible by adhering to three core principles.
The principles of Data Oriented Programming are:
When these 3 principles are combined together, they form a cohesive whole that allows us to treat data as a first-class citizen. As a consequence, we improve our developing experience and make the systems we build easier to understand.
In a Data-oriented system, code is separated from data and the data is represented with generic data structures that are immutable.
It should be noted that for OO developers, the transition to DOP might require more of a mind shift than for FP developers, as DOP guides us from the beginning to get rid of the habit of encapsulating data in stateful classes.
Throughout the book, we will explore in-depth how to apply DOP principles in the context of production information systems.
Written in a conversation style that hopefully makes it fun to read and easy to digest, the purpose of the book is to spread the word about DOP among the global community of developers so that they build systems that are less complex.
If you’re curious to learn more about Data Oriented Programming you can buy the book here. Use our promo code aff46421 for 30% off.
Marketing Manager at WorksHub
See other articles by Mihaela
Ground Floor, Verse Building, 18 Brunswick Place, London, N1 6DZ
108 E 16th Street, New York, NY 10003
Join over 111,000 others and get access to exclusive content, job opportunities and more!