2 ms·
I thought that data oriented programming was a paradigm that sits next to Object Oriented and Functional programming and I had a lot of trouble understanding th
by wodenokoto 6y ago
I thought that data oriented programming was a paradigm that sits next to Object Oriented and Functional programming and I had a lot of trouble understanding the DOP-related articles that have been trending on HN recently.
But apparently it is just what we in R and Python call vectorised functions.
To boil it down:
non-vectorised:
square(2) -> 4
square([2,4]) -> error
vectorised:
square(2) -> 4
square([2,4]) -> [4, 16]
Which doesn't care whether you are passing messages between objects or avoiding side effects through pure functions and monads or imperatively muting your data left and right.
Or am I completely off?