who wrote this shit?

This post is a response to Philip Heltweg’s “who wrote this shit” post.

I like the post linked above, it describes a junior developer who internalises the behaviour of ;

  • see some bad code
  • git blame to find out who wrote it
  • expect to see a name that you don’t recognise
  • mutter with discontent

The author of the original post goes on to describe the case when he was pairing with a developer he respected, and found the bad code’s author was this very same developer.

The author has an immediate spoonful of ~medicine~ empathy and humility as he realises we can all write bad code, and wonders what environment that code was writing within.

I want to go one step further and say, I enjoy it when it’s my own name listed in the git blame against the offending lines of code.

We were all junior engineers at some point. When I see some code that I know to be bad, and when I see that it was me who wrote it I don’t feel the sense of dread of being “bad”. Instead, it’s wonderful.

  • Imagine if I didn’t know that was bad code?
  • Imagine if I had always been writing code like that?

The fact that I can see now that something is bad means that I am a better engineer than I was before. I have learnt something. I am grateful to see my name against bad code, because at least I now know it’s bad.