11

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.

Thanks.

1
  • 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

2 Answers 2

16

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.

4

It may have changed since 2009, but the implementation was described in this Coding Horror blog post.

1

You must log in to answer this question.

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