Diffing comments is surprisingly hard. In difftastic, I'm colouring the whole changed comment, but also underlining the changed words.
This works OK, but punctuation is harder to read (see second image) and sometimes there's code in comments (see third image).
miniblog.
Related Posts
I hear people say that Go is often hard to search online (hence sometimes "Golang"), but the vast majority of language names are common words. Names with punctuation (C++, C#) are hard too.
Is this a big problem in practice? "Perl" isn't a dictionary word, but it's an exception.
Difftastic 0.36 is out! In this release:
* Better diffs: Punctuation is now treated separately in the cost model
* Nicer display: Changes in comments are now underlined too
* New languages: Hare, Pascal and QML
* Smarter detection of binary files
I've documented several additional interesting challenges for syntactic diffing: meaningful comparisons of large string literals, understanding blank line changes, and autoformatters adding minor punctuation!





