Today I Learned about Difftastic

Adding Another Tool for Code Review and Comparison

Today I learned about Difftastic:

Difftastic is a structural diff tool that understands syntax. It supports over 20 programming languages and when it works, it’s fantastic.

Instead of showing changes by line, it shows changes by syntax tree. In other words, if you wrap a chunk of code in an if statement, difftastic will show the newly added if as the change even if you indented the chunk of code.

This helps focus in on what has changed. Difftastic uses tree-sitter to build the parse tree. Tree-sitter is also used for syntax highlighting of source-code.

All told, difftastic is a fantastic addition to the toolkit for software development.