Git Product home page Git Product logo

data-oriented-programming's Introduction

Data-Oriented programming

Source code for Data Oriented Programming book

Other implementations

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!

data-oriented-programming's People

Contributors

arnehormann avatar chase-lambert avatar daskycodes avatar konfuzian avatar mchampine avatar mikemar10 avatar raff avatar shaolang avatar thomaseyde avatar viebel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

data-oriented-programming's Issues

wrong condition in threeWayMerge?

if(havePathInCommon(previousToCurrent, previousToNext)) {

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.

havePathsInCommon will always return false for nested objects

the havePathInCommon function of chapter 5 uses lodash intersection which will always return false.

function havePathInCommon(diff1, diff2) {
return !_.isEmpty(_.intersection(informationPaths(diff1),
informationPaths(diff2)));
}

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.