Hacker News new | ask | show | jobs
by hinkley 637 days ago
If you’re still using a diff tool that can’t do sub-line diffs it’s time to join the 20’s. I haven’t been forced to use one of those in over ten years.
1 comments

> If you’re still using a diff tool that can’t do sub-line diffs it’s time to join the 20’s.

I think you failed to understand what I wrote.

Leading comma ensures one line diffs, but trailing comma forces two-line diffs when you add a trailing argument. With trailing comma, you need to touch the last line to add a comma, and then add the new argument in the line below.

We are not discussing bundling all arguments in a single line. I don't know where you got that idea from.

> Leading comma ensures one line diffs

It does not. It just moves the edge case to a different position: trailing comma has the "issue" when adding an argument to the end of the list while leading comma has it when adding an argument to the beginning.

Also, as pointed out by the other commenter, any decent modern diff tool will make it obvious that the change to the existing line is just the addition of a comma, which makes the difference basically moot.

What’s the value in doing this unless it makes the diff clearer?

It only makes the diff clearer if you don’t have single character highlighting in your diff tool. Which most have now. Have had for a decade.

Also it’s not going to be a single line anyway. You add a line to the query and one to the caller. At a minimum. So you’re really arguing for three versus four. Which is false economy.

> What’s the value in doing this unless it makes the diff clearer?

Because it makes the diff clearer.

Are you even reading the posts you're replying to?