6
Glinkis
6y

Would you guys get annoyed if someone(me) made a habit of going through your code and cleaned things up, such as clearer naming, untangling ifs with early returns and so on.

I mean doing stuff that doesn't change the behavior, but makes it easier for the next person.

Comments
  • 4
    yes that would annoy me a lot if you don't have that task assigned to do. But if you are doing code reviews of my code this is legit to point out to me what I can/should do better.

    And if you are refactoring anyway then you can do that as well.
  • 3
    Depends if I know you are doing it or not.
    If I know you’re doing it, hen go for it. If you’re doing because you think it’s better, don’t! Because when I need to come back to that tangled mess, I’m going to be confused on why it’s not what I expected.
  • 3
    Also depends on what code it is. If I'm working on something, most of my code looks really bad. I only start cleaning up after getting the code to work and preparing for a review.

    So I would definitely mind, if you change that code. Once that code made it into master, it is fair game IMO.
  • 1
    @C0D4 the idea is to make it less of a tangled mess.
  • 1
    @korrat Yes, that's a very good point.
  • 0
    Are you the code scavenger guy?
  • 0
    @zvyn some valid points, though most of them depends. Blindly refactoring is bad, but if you have tests, you can refactor away as long as the tests pass.

    But what you're saying is that someone should never refactor somebody elses code. That's ridiculous.
  • 2
    Another point @zvyn brought up is your relation to the project. If you are part of the project you probably can refactor the project, while someone external should only keep to the parts he already touches during his pull request
  • 0
    @korrat Yes, I agree with this. I wouldn't do one massive pull request with the whole project refactored, but rather small ones that only touches specific issues.
Add Comment