Advantages of Data-Oriented Programming
What You Gain by Separating Data from Logic
Many different programming styles evolved over the years, and one that you might not be familiar with is termed data oriented programming. This style become especially popular with Clojure developers in recent years. Let’s take a look at the idea behind this style and some of the advantages it affords.
Ultimately, all that code is doing is transforming data. A program starts with one piece of data as the input and produces another as its output. Mainstream languages attempt to abstract over that using object-oriented semantics. While the practical value of such abstraction is not entirely clear, there are some tangible problems associated with this approach.
Let’s take a look at some drawbacks to structuring programs using OO style.
Object-Oriented Drawbacks
Traditionally, an object can be thought of as a type of state machine that contains some data fields representing its internal state and provides some methods for manipulating it. An object represents the smallest compositional unit in OO, and a program is structured…