Web lists-archives.com

Re: Is it bad manners to refactor other people's code?




El 25 ene. 2018, a la(s) 14:45, Michael Heidelbach <ottwolt@xxxxxxxxx> escribió:

> Hi!
> 
> Currently I'm working on some code I couldn't understand until I split some long functions into smaller parts.
> 
> As I couldn't find anything about the size-of-a-function topic in the KDE or Qt guide lines I consider this as a matter of personal taste.
> 
> I don't want to step on anybody's toes, so my question is: Should I submit the refactored code as a review request or - now that I understand what is going on - weave my changes into the original code? And what do you think about this in general?
> 
> 
> Michael
> 

Pushing a big refactor directly could be considered bad form (unless the original author is inactive and you turned into the new de-facto maintainer).

But that's what code review is for! Either your change is welcome as making the code more readable, or reviewers disagree and it gets rejected. Or most likely, a brief discussion happens on specific parts of your change that they disagree with, and the end result is even better.

I think you should send a review request. The important thing here is good communication :)

-- 
Nicolás