Skip to main content
added 1279 characters in body
Source Link

I've been asked to review some code changes and when I see the code, well... I just don't like it! There must be a better way of doing this, but I can't think of one off the top of my head.

So I ask the developer and they tell me the reason for doing it this way, but I'm not 100% convinced. (I can even suggest another way, but they point out a complication with doing it my way, which I think could possibly be resolved / worked around.)

The problem is now that my choices are either

  • I take their word for it and approve the changes,
  • I spend hours myself researching the problem, trying to come up with a better way or trying to resolve their complication
  • or worse - send them away with the vague, open ended statement to try and find a better way themselves which either might not exist or might be beyond their ability, in which case it would be both a waste of time and demoralising / insulting.

None of these seem like good solutions

What is the best practice for handling this scenario?

Edit (in response to comments)

Thinking about it a bit more - the problems are usually along the lines of introducing complication or maybe poor development practices, e.g.

  • the code is now overly complicated (but the dev feels that this complication is required).
  • They've introduced new methods, classes, interfaces whereas I think the change could be handled using what we have already. (the dev has identified a snag with this which would take some work to figure out whether this can be rectified).
  • it breaks our current style / design patterns (again the dev feels that this is necessary in this case but I'm not so sure).
  • it introduces certain "brittleness" - e.g. hard-coding or ineffective use of interfaces. (again the dev feels this is the only way to make it work)
  • it may introduce potential for hitherto unknown problems to arise, or problems surrounding scenarios that the dev believes "will never happen" and I can't prove otherwise.

In each case, the point is that off the top of my head I can't give them a better alternative, and the only way of doing so is for me to invest so much time in figuring one out that I might as well have done the work myself, and there's a chance it'll end up that they were right all along.

I've been asked to review some code changes and when I see the code, well... I just don't like it! There must be a better way of doing this, but I can't think of one off the top of my head.

So I ask the developer and they tell me the reason for doing it this way, but I'm not 100% convinced. (I can even suggest another way, but they point out a complication with doing it my way, which I think could possibly be resolved / worked around.)

The problem is now that my choices are either

  • I take their word for it and approve the changes,
  • I spend hours myself researching the problem, trying to come up with a better way or trying to resolve their complication
  • or worse - send them away with the vague, open ended statement to try and find a better way themselves which either might not exist or might be beyond their ability, in which case it would be both a waste of time and demoralising / insulting.

None of these seem like good solutions

What is the best practice for handling this scenario?

I've been asked to review some code changes and when I see the code, well... I just don't like it! There must be a better way of doing this, but I can't think of one off the top of my head.

So I ask the developer and they tell me the reason for doing it this way, but I'm not 100% convinced. (I can even suggest another way, but they point out a complication with doing it my way, which I think could possibly be resolved / worked around.)

The problem is now that my choices are either

  • I take their word for it and approve the changes,
  • I spend hours myself researching the problem, trying to come up with a better way or trying to resolve their complication
  • or worse - send them away with the vague, open ended statement to try and find a better way themselves which either might not exist or might be beyond their ability, in which case it would be both a waste of time and demoralising / insulting.

None of these seem like good solutions

What is the best practice for handling this scenario?

Edit (in response to comments)

Thinking about it a bit more - the problems are usually along the lines of introducing complication or maybe poor development practices, e.g.

  • the code is now overly complicated (but the dev feels that this complication is required).
  • They've introduced new methods, classes, interfaces whereas I think the change could be handled using what we have already. (the dev has identified a snag with this which would take some work to figure out whether this can be rectified).
  • it breaks our current style / design patterns (again the dev feels that this is necessary in this case but I'm not so sure).
  • it introduces certain "brittleness" - e.g. hard-coding or ineffective use of interfaces. (again the dev feels this is the only way to make it work)
  • it may introduce potential for hitherto unknown problems to arise, or problems surrounding scenarios that the dev believes "will never happen" and I can't prove otherwise.

In each case, the point is that off the top of my head I can't give them a better alternative, and the only way of doing so is for me to invest so much time in figuring one out that I might as well have done the work myself, and there's a chance it'll end up that they were right all along.

Question Protected by gnat
Became Hot Network Question
Source Link

What to say in a code review when I don't know how it could be improved?

I've been asked to review some code changes and when I see the code, well... I just don't like it! There must be a better way of doing this, but I can't think of one off the top of my head.

So I ask the developer and they tell me the reason for doing it this way, but I'm not 100% convinced. (I can even suggest another way, but they point out a complication with doing it my way, which I think could possibly be resolved / worked around.)

The problem is now that my choices are either

  • I take their word for it and approve the changes,
  • I spend hours myself researching the problem, trying to come up with a better way or trying to resolve their complication
  • or worse - send them away with the vague, open ended statement to try and find a better way themselves which either might not exist or might be beyond their ability, in which case it would be both a waste of time and demoralising / insulting.

None of these seem like good solutions

What is the best practice for handling this scenario?