7

Instead of ranting I thought it would be nicer to ask for opinions/solutions: How to cope with a collegue that keeps producing trainwrecks of code which you have to first refactor to make it work in a more logical/structured way? Yes, his initial solution works (in a way), but it's just not how 99% of the other developers would solve it. And yes, we've shown him quite a few times how it should/could be (in a positive and constructing manner)

Comments
  • 1
    Welcome to devRant! You did your best. Management must speak with the dev at this point. Are they?
  • 1
    We don't refactor someone's code while they are still around to do it themselves. And nothing gets committed that isn't reviewed and unit tested..

    With devs in training, we usually use pair programming. We agree on a solution first, then the senior dev lays out the code structure and then guides the junior while she implements the actual logic.

    It's time consuming at first but effective in the long run.
  • 0
    A little side note maybe: we are in different locations so pairing up is sometimes a bit hard to do. We've talked to management before and it improved a bit, but now it seems to be going in the wrong direction again.. I also got the feeling he's just wired like this and doesnt (want to) understand other solutions, even though we agreed upon one beforehand.
  • 0
    @arminiae Good point! I'll bring it up in the retrospective that before writing any line of code, the proposed solution should be discussed with a fellow developer. And if any pull request comes in with a solution that has not been discussed, decline without looking at it. Make him learn it the hard way?
  • 0
    @broodzak I see. Well, if pair programming is not an option, there's always the QA guy (still a dev with automatic code analysis tools). Ours flat out rejects code that doesn't meet company standards, so the culprit will have to rework it over and over. After a while, people just get tired and do stuff right. Of course, you would need management to stand behind this...
Add Comment