14

You may recently have seen my question How do I tell a coworker he's wrong?

Well the time has come where I got a long email being blamed for sloppy coding done by said coworker.

I'm not a blamer. I'll say it again: I'm not a blamer. My immediate email response was "I see the mistakes, I'm on it. I'll have it fixed ASAP".

But it's not fair that I should be blamed for writing bad code when I didn't, and when there is a "Git Blame" proving that I didn't.

For those that don't code, a "Git Blame" is a line-by-line breakdown of who wrote what code.

I informed my boss that the code was, in part, a joint effort, which contributed to sloppiness. I don't want to sound like a complainer, I don't want to get thrown under the bus, and I don't want to throw anyone over the bus.

How do I deal with getting blamed for my coworkers sloppy code?

--EDIT--

To be perfectly clear, 80% of the code was checked in by coworker (sloppy). I was directed to write another layer (20%) on top of that (I don't think it was sloppy). I got 100% of the blame.

I realize that hypothetically I could have refactored his code when adding on to it, but in our company this would not work. We have too much to do and too few developers.

  • 1
    *comments removed* Please remember to be nice. – jmac May 16 '14 at 1:27
  • 3
    One of my favourite sayings: It's not my fault, but it is my problem. Your boss may have asked you to fix it because he knows the other person can't, not because he thinks you made a mess – Kate Gregory May 16 '14 at 18:28
  • 2
    " I could have refactored his code when adding on to it, but ...we have too much to do and too few developers". Well now you are doing extra work to fix the mess, which you also presumably don't have effort for. It's frequently better to fix the mess up front. – DJClayworth May 16 '14 at 19:36
  • 4
    The next time someone chews you out for refactoring crappy code, tell them this story. – DJClayworth May 16 '14 at 21:23
  • 1
    Do you do code reviews at your place? Code reviews are the place where you would check that the code being checked in by someone else is of sufficient quality, and reject the checkin if it isn't. Best case: Co-worker learns writing better code. Worst case: Co-worker complains to boss, boss overrides your objection, code doesn't work, boss knows that it was against your advise. – gnasher729 Jul 11 '14 at 8:11
11

I can't tell here, did you write the code or did the coworker?

If you checked it in then it's all on you to fix. After all you shouldn't have checked garbage in.

If your coworker made the changes and checked it in then you run the blame report and send a screen shot of that, with appropriate highlighting, as a response to the person that sent you the long email. That should be all it takes.

If you both checked in changes that simply don't work well together, then it's still on you to fix it as you are at least partially responsible.

This isn't about throwing people under a bus. As a manager, if I haul off on a person because of something that someone else did then I would hope that the employee would politely tell me what's what. I'd then apologize and vent my ire where it belongs.

However, if I think that you are causing more problems than you are fixing then I'll likely have some words with you and eventually replace you. Again, if you don't speak up then you may as well be guilty.

  • I've edited to clear up who wrote what – OneChillDude May 15 '14 at 23:49
  • 29
    Best response: "After initial review, the code in question is not mine. However, I will complete the assigned code cleanup by {Thursday}." No blaming, but no accepting incorrect blame. Just the facts and a promise to perform the assignment. – Wesley Long May 16 '14 at 1:27
  • 9
    @BrianWheeler - Don't accept the blame. Ignore blame. It is a faulty concept from immature and defensive thinking. Report the facts: "The code in question is not mine." Accept the assignment: "I will complete THE (Editing myself) assignment by Thursday." – Wesley Long May 16 '14 at 1:32
  • 1
    @WesleyLong, that would make the basis of an excellent answer to the question. – Roger May 16 '14 at 16:28
  • 1
    @Roger - eh, there's already an accepted answer, and a good one. I was just laying down a bit of "practical application" for it. – Wesley Long May 16 '14 at 17:09
-6

All you have to do is point out that he wrote the code and back up your assertion. It's that simple. Don't make it complicated.

You write that the "code was a joint effort" and you wonder why you got nailed for the code and you're asking us how to get out from under the blame. You just muddied the waters, pal. And you screwed yourself big time when you wrote that "the code was a joint effort", meaning that you are fully blamable. Are you trying to get yourself fired for what the other guy did? Because it sure looks like it.

What you have to do is make it clear that your partner in crime wrote the code. Now. And going forward, think about the implications about what you are saying before you say it. In general, you acknowledge responsibility for your own actions. You do NOT acknowledge responsibility for somebody else's actions. Not unless you have direct authority on them.

Follow-up comment from OP Well I don't think I "screwed myself big time". No one is getting fired. The situation is mildly irritating at worst

It's good to hear that you're not getting fired. But be careful - Emails are not usually that long. And checking in defective code into repositories is not a small matter

Follow-up comment from @jammypeach I didn't downvote, but I have to point out that while the OP was blamed for the problem he was also assigned the task of fixing it. Him saying that he didn't write the problem code does not complete the assigned task nor does it come off as professional IMO. I think the answer written by Chris addresses this in a way that's less likely to cause an problem for the OP

@ChrisLively wrote "As a manager, if I haul off on a person because of something that someone else did then I would hope that the employee would politely tell me what's what. I'd then apologize and vent my ire where it belongs." If the OP does not speak for himself, he can pretty much assume that nobody will. I am pretty sure that Chris would not take it well the answer that "the code was a joint effort" and he would conclude from that answer that the OP was partially responsible for the code - I would. If the OP was specifically assigned the task of cleanup, he complies but he should not give anyone the impression that the code he is cleaning up is his. Part of being a professional is being accountable. And part of being accountable is putting the accountability where it belongs.

Follow-up comment from @ChrisLively "Your assumption about how I would take that is correct. Also I agree that the OP should point out whose code it was. WesleyLong above had perhaps the best way to phrase such an email."

For reference, the comment from @WesleyLong "Don't accept the blame. Ignore blame. It is a faulty concept from immature and defensive thinking. Report the facts: "The code in question is not mine." Accept the assignment: "I will complete THE (Editing myself) assignment by Thursday."

Personally, I already get enough justifiable blame for the things I did or din't do without having to deal with getting blamed for what somebody else did or didn't do, on whom I have no control or influence.

  • 3
    Well I don't think I "screwed myself big time". No one is getting fired. The situation is mildly irritating at worst – OneChillDude May 16 '14 at 5:31
  • It's good to hear that you're not getting fired. But be careful - Emails are not usually that long. And checking in defective code into repositories is not a small matter. – Vietnhi Phuvan May 16 '14 at 12:58
  • 3
    @VietnhiPhuvan I didn't downvote, but I have to point out that while the OP was blamed for the problem he was also assigned the task of fixing it. Him saying that he didn't write the problem code does not complete the assigned task nor does it come off as professional IMO. I think the answer written by Chris addresses this in a way that's less likely to cause an problem for the OP. – nurgle May 16 '14 at 15:19
  • @jammypeach I incorporated your comment into my answer - with full attribution, of course, and I replied to it :) – Vietnhi Phuvan May 16 '14 at 15:42
  • @VietnhiPhuvan: Your assumption about how I would take that is correct. Also I agree that the OP should point out whose code it was. WesleyLong above had perhaps the best way to phrase such an email. – NotMe May 16 '14 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.