> Or maybe you prefer to code with the classic old-school text editors, like vi (2012), Sublime Text (2008), or vim (1991)<p>Huh, vi was introduced 15 years after I first used it. Must have been inspired by vim. Think I’ll stop reading here.
We had, back in the '90s, a 'semantic diff' that ignored whitespace, knew about programming languages, showed only significant code changes (not comments; not empty lines; not refactoring of code into a different number of lines). All I used after that.
isn't difftastic the new way to do this? <a href="https://news.ycombinator.com/item?id=39778412">https://news.ycombinator.com/item?id=39778412</a><p>I highly recommend trying it out.
- <a href="https://github.com/dandavison/delta">https://github.com/dandavison/delta</a> is nice for a prettier presentation of the same information as `git diff`.<p>- This may or may not qualify, since I think GNU diff supports it with an option, as does Git diff, but "Color-words" diff can be nice, where changes in the middle of the line are highlighted and whitespace is ignored.<p>- Somebody already recommended <a href="https://github.com/Wilfred/difftastic">https://github.com/Wilfred/difftastic</a>, which I second. It uses treesitter and is very interesting. Surprisingly, in practice difftastic is not always noticeably better than color words diff (don't expect miracles), but occasionally it is much better.<p>For the last two, see Difftastic's FAQ, <a href="https://github.com/Wilfred/difftastic#isnt-this-basically---word-diff---ignore-all-space">https://github.com/Wilfred/difftastic#isnt-this-basically---...</a><p><i>Update:</i> Finally, this blog post about difftastic describes some details: <a href="https://www.wilfred.me.uk/blog/2022/09/06/difftastic-the-fantastic-diff/" rel="nofollow">https://www.wilfred.me.uk/blog/2022/09/06/difftastic-the-fan...</a><p><i>Update 2:</i> Finally finally, Difftastic's wiki has more related tools: <a href="https://github.com/Wilfred/difftastic/wiki/Structural-Diffs">https://github.com/Wilfred/difftastic/wiki/Structural-Diffs</a>. Difftastic's author writes many interesting things, it seems :).
I think diff is at least 50 years old. It shows up in the unix v5 source from 1974.<p><a href="https://minnie.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/s1/diff1.c" rel="nofollow">https://minnie.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/...</a>
I think I need a tldr for a 12 year old because my answer to that question is: does it need to be improved?<p>Diff, like all the original Unix tools was only meant to do one thing, compare two files. The beauty in that being that it can be a core component of whatever you want.<p>UI extensions, algorithm adjustability to name some. But based on what Myers mentioned as someone else said, “improved diff” is partially a semantic diff. One that’s less cold blooded about trivial changes like white spaces.<p>I don’t mean to be the typical pedantic HN commenter but that sounds like a diff of commit objects rather than files.