- Adding a line: ✅
- Removing a line: ✅
- Modifying a line: ✅
- Moving a codeblock: ❌ i see you’ve rewritten everything, let me just highlight it all.
RIP reviewers on my PR.
(Meme created by my coworker)
I’m surprised that after almost 20 years of versioning C code, git still manages to assign the closing brace of a function wrongly.
I’m convinced there must be a way of using ASTs to do more intelligent diffing of a given programming language, but I’m far too lazy to find out for myself.
Diffing algorithms on trees might not be as efficient, especially if they have to find arbitrary node moves.
I wouldn’t expect it to be, but I think modern processors can handle the load!
It’s not necessarily about the load, it’s about the algorithmic complexity. Going from lists (lines in a file, characters in a line) to trees introduces a potentially exponential increase in complexity due to the number of ways the same list of elements can be organized into a tree.
Also, you’re underestimating the amount of processing. It’s not about pure CPU computations but RAM access or even I/O. Even existing non-semantic diff implementations are unexpectedly inadequate in terms of performance. You clearly haven’t tried diffing multi-GB log files.
Me adding one if statement around around a code block. Ah shit I guess I own the whole function now.
laughs in IntelliJ