r/coding • • Aug 22 '17

You're using git wrong

https://dpc.pw/blog/2017/08/youre-using-git-wrong/
30 Upvotes

71 comments sorted by

View all comments

58

u/ReginaldDouchely Aug 23 '17

Have you ever did a code review, and gave feedback that was longer than doing the fix yourself, while you’re at it?

Yeah. It's called being the most senior member of the team, and it's worth the learning opportunity.

-5

u/dpc_pw Aug 23 '17

I think you've missed the point. The problem is not being able to fix the code inline in Gerrit/Phabricator/Github code review UI, and having to describe required changes in a human language instead, then waiting for the author to implement them, and then having to double check if they were implemented like you wanted.

18

u/recycled_ideas Aug 23 '17

Which is intentional.

The point of a review is to transfer knowledge.

Yes, explaining to someone else how to fix the code is hard, but it's the entire point of the process.

-3

u/dpc_pw Aug 23 '17

The transfer of knowledge is very valuable. But very often the actual fix is a better explanation, than the description. To give a succinct example:

This method should be private.

is much longer to write and read than looking at the diff that is making the function private.

Or:

Here I have quickly changed your code to use an utility class Foo. Please use it next time.

is better than (obviously exaggerated):

Please use `Foo` utility class that you've never seen before. You might find some examples in a file `src/java/ourorg/module /submoduley/foo.java`, though it can be a little bit tricky. Just figure it all out. There's no documentation on how to use it yet. If you have troubles, good luck catching me between my meetings this week, LOL.

14

u/recycled_ideas Aug 23 '17

Yes it's shorter, but that's mostly because your code review comments are shit.

Why should the method be private?

How do they use utility class Foo and why should they use it.

In your solution the person asking you to review doesn't learn anything, so they don't stop making mistakes. Maybe they didn't use Foo because the documentation on how to use Foo or even that Foo exists is crap.

Them making the change is the whole point. It's not broken, it's supposed to work that way.