He doesn't comment on it in PRs, or only makes minor comments. He lets things get approved by other people and then goes back and quietly rewrites it later and has his buddy approve it. Sure, my code could use some improvement occasionally. But it isn't <i>that</i> bad and he could just comment on it when I do a PR. He does not do this to anyone else.<p>I don't want this to be about the fact that I am a minority in tech and the only one on the team. But, I am pretty sure it is. My career has been blissfully absent of these kinds of issues thus far and I have no idea how to handle it.
> and then goes back and <i>quietly</i> rewrites it later and has his buddy approve it.<p>Emphasis mine. I think "quietly" is the key:<p>He quietly rewrites it and quietly gets his buddy to accept it.<p>My guess is he scared away a new hire recently by some comment on their PR and is doing his best to avoid doing that mistake again.<p>Again, quietly is key here.<p>I've dealt with some people I'd consider brilliant a$$holes and this - as far as I can read - is quite far from it.<p>(I'm not judging on if it is a good or a bad idea, only that I'd surely take it as a sign that he wants you to stay and want to avoid embarrassing you.)<p>Edit:<p>Re-reading it this caught my eye:<p>> I don't want this to be about the fact that I am a minority in tech<p>This makes me even more sure about my conclusion. He wants you to stay and is afraid that you'll leave if he is too direct.
After reading a lot of the feedback here, I spoke to my tech lead.<p>He admitted that he had been significantly harder on me than others because I was less experienced. He trusted it less and it was easier for him to just rewrite than bother with actually doing a proper code review. Not because my code was "shit".<p>I came with receipts. He admitted this was deeply unfair and unprofessional agreed to start doing proper code reviews.<p>Thanks for the feedback, everyone.
Passive aggressive behaviour, which sounds very unprofessional.<p>If his manager is enabling or ignoring this behaviour, I would wager there is some toxic culture in action here.<p>Having said that, you should have a manager that you can give and get feedack to and from. Be open to criticism but also note any behaviour you feel is unfair or unbalanced.<p>If it looks like noone cares to openly discuss this behaviour I would start looking for a new job.
Incidentally, it's mildly preferable to have one's code surreptitiously re-written than to be needled in code review purgatory. The organization as a whole moves forward with the least amount of verbal back-and-forth, and you still bump up your commit count. Learn from it, and when you get good enough to re-write others' code, try to be more mentorly.
> I don't want this to be about the fact that I am a minority in tech and the only one on the team. But, I am pretty sure it is<p>No, it's not.<p>Be an adult and demand that your manager provide a thorough explanation on why he is rewriting your code. If your code is shit, then make him tell you so you can improve.
I've both had my code savagely re-written, and savagely re-wrote a lesser's
code. Every good programmer is something of a control freak, and for good
reason. Nature of the beast I'm afraid. "Don't hate, appreciate" applies here.