4 ms·
Always wanted to ask: Isn't google's diff-match-patch library suitable for the same thing? It can apply patches to altered input pretty nicely. Is there a conc
by Inviz 14y ago
Always wanted to ask: Isn't google's diff-match-patch library suitable for the same thing? It can apply patches to altered input pretty nicely.
Is there a conceptual difference? Diffs support all types of operations - insert, remove, replace. I'm really curious about realtime collaboration, but can't decide which is the right tool for the job.
- tarr11 14y agoOperational transform is not the same as diff-match-patch. DiffMatchPatch gets confused pretty easily around similar content. It uses lexical similarity to determine the patch. It often fails, and the API actually tells you that it was unable to apply a patch. For example, if you make a huge change to a file, diffMatchPatch will be unable to generate a patch file. Operational Transform, on the other hand, uses some an ordered sync to ensure that changes are applied in a consistent way across all clients. It woudln't fail in the same way and is resilient to more kinds of changes.