Source code for Data Oriented Programming book
Have you implemented part of the tasks mentioned in the book in a programming language that you like? Open a PR with a link to your repository!
- Typescript by shybyte
- Java and Paguro by GlenKPeterson
Source code for Data Oriented Programming book
Have you implemented part of the tasks mentioned in the book in a programming language that you like? Open a PR with a link to your repository!
Hi, besides the code in this library, is there some open source project or larger example for DOP that's not implemented in Clojure?
if(havePathInCommon(previousToCurrent, previousToNext)) {
return _.merge(current, previousToNext);
}
In the book, the explanation for the code above is:
"In order to determine whether there is a conflict, we calculate two diffs: the diff between previous and current and the diff between previous and next. If the intersection between the two diffs is empty, it means there is no conflict. We can safely patch the changes between previous to next into current."
Per my understanding the condition should be negated: if(**!**havePathInCommon(previousToCurrent, previousToNext)) { ...
It seems that the code throws exception if the intersection is empty.
the havePathInCommon
function of chapter 5 uses lodash intersection
which will always return false
.
data-oriented-programming/src/chapter05/paths-in-common.js
Lines 1 to 4 in 07bf95b
havePathInCommon
uses informationPaths
which returns an array of the paths, where each path is an array with keys as values of the array.
A return value example of informationPaths
would be:
[
['library', 'catalog', 'authorsById', '1', 'name'] ,
['library', 'userManagement', 'userssById', '1', 'name']
]
but lodash's intersection will not deeply check this nested array, so if the above path was compared with
[
['library', 'catalog', 'authorsById', '1', 'name'] ,
]
It will return false because arrays are reference type.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.