Neil's News

+ 2010
+ 2009
+ 2008
+ 2007
- 2006
 Entropy
 About Work
 Cartography
 Unplugged
 Fledermaus
 Nickels and Dimes
 Voxel Sphere
 Moo Down
 Googled
 Night Vision
 Teamwork
 Carleton
 Design Patterns
 Table Sorter
 Course Correction
 MobWrite
 Instant Delete
 Beirut
 WbOsMuRtPtE
 Diff, Match & Patch
 Fuzzy Patch
 Fuzzy Match
 Diff Cleanup
 What's the Diff?
 Diff Accelerators
 Widget
 Lord of the Rings
 Makers
 Generic Icons
 Colour Picker
+ 2005
+ 2004
+ 2003
+ 2002

What's the Diff?

19 March 2006

Part of my dissertation requires that I compute the difference between two texts using JavaScript. On the surface this seems like a fairly simple and generic problem.

Sure enough, an existing solution was available. Unfortunately it is buggy in its implementation, and flawed in its design. Another existing solution had no implementation bugs, but was based on the same flawed design. Yet another existing solution is so buggy it can't even detect equality (try "Hello Hello" on both sides).

Admittedly 'diff' is a tough nut to crack. It took quite a while to create my own version. Every speed-up I can think of has been added. Try it out:

Version 1:
Version 2:

< Previous | Next >

 
-------------------------------------