In our software development group, another developer, not standing higher in the hierarchy, keeps rewriting significant parts of the code I contribute.
The code being rewritten works as expected, is covered by passing tests and does not have very obvious deviations from the coding rules (these are rather purely defined). The code becomes much more sophisticated after rewrites, with multiple layers of indirection and often "better" implementations of functionality than is provided by the standard libraries. These changes are never discussed with me in advance, while they of the kind reviewed and discussed with somebody else within the team. The team is split between the two departments, and the co-worker can always find developers closer to him for discussion and approvals.
The developer claims that rewritten code "has the better design". This may be true to some degree, as this is the second iteration, based on experience of the first iteration. Still, he is not doing other tasks at this time. The project lags behind the schedule significantly and I am afraid to stay responsible for this. Also, I do not always think that the rewritten code has better design.
One of the possible solutions would be to escalate to the management, but this is my team, the people I work with and would likely need to work in the future. I could provide lots of samples proving that another developer is not as good as he thinks, sometimes lacking understanding even about the basic data structures, like list or map (or having no experience in the programming language used?). However I do not want to enter into confrontation that would be ended by one of us being fired or forced to leave the team. Is there any other approach to the problem?