Re:Ask HN: Data-Oriented programming vs. Functional programming
by viebel on Friday March 12, 2021 @10:03AM
(#26436513)
Please, don't confuse DoD and DoP
Re:Ask HN: Data-Oriented programming vs. Functional programming
by mercer on Friday March 12, 2021 @11:53AM
(#26437798)
I feel you're making a distinction that some people decided to make, but that is not really widely shared by others to warrant imposing it.
I see you also posted two differently-titled links to your "Data Oriented Programming" book last month. That does make it feel a bit like you're submarining your book with an 'Ask HN'.
My apologies if I sound negative. On a more positive note: perhaps write a good blog post about this, and perhaps the core of what your book is about? I imagine that would be much more appreciated than just a low effort link to the book or "Ask HN".
p.s. given that I strongly disagree with your definitions of DO and FP.
DOD/P: Data oriented design and programming is structuring code in light of form, size, access patterns of data. Efficient access and ops on domain specific data is the name of the game. Strictly speaking, this is an optimization approach and not a genuine general programming paradigm. In sum: organize your data layout to maximize efficient processing suited to your application. (DB analog: 1st normal form is DoD. 5th normal form is anti-DOD.)
FP: true to its mathematical origins, FP is mainly about transformation of data via a methematical treatment. Arguably, algorithms are far more central to FP than data. A significant manifestation of this fact is the existence of "lazy" and "strict" evaluation in FP runtimes which flies in the face of the primary concerns of Data Oriented Programming (which came from gaming). FP in no way addresses memory layout as a primary concern. FP is a conceptual general purpose paradigm.