12

I am referring to this feature:

Stack Overflow version control feature

Note how Stack Overflow shows which bits have been deleted, and which parts have been added (shown in red and green).

Basically, I was wondering if Stack Overflow used an external piece of software for this capability. If they did not, could I know how they implemented such a thing (and how I could implement it in PHP)?

The main reason I think this is a plugin / external piece of software is because I was reading a post stating that the Stack Overflow live preview editor was made using WMD Markdown Editor.

2
  • It may have changed since 2009, but the implementation was described in this Coding Horror blog post.
    – Gelatin
    Jan 16, 2014 at 2:14
  • There are many programs and libraries for diffing. “diff” on your favourite search engine. diff is also a common utility.
    – Ry-
    Jan 16, 2014 at 2:20

1 Answer 1

19

Per balpha, Stack Exchange uses an in-house diff engine based on a particular implementation of Eugene Myers' O(ND) difference algorithm, with several enhancements to support more natural diffing.

For brevity, I'll refer you to his fairly detailed post for an indepth overview.

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .