I have this rule marked as "Unknown" because I'm not sure where it originated. I first heard the concept on a podcast a while back (sorry, I don't remember which one). I've been hoping to track down the originator of this because I would love to give him/her credit for it.
The Joy of the Internet
Shortly after I published my video last week, I saw my name come up in a Twitter thread that started here (just click on the photo to see the full thread):
Motivação para escrever software limpo, elegante e testado (um slide de meu curso atualizado de testes ágeis) #agile pic.twitter.com/etCR8RNTOZCesar took motivation from my Clean Code talk to include in his presentation on Agile Testing. This kicked off a discussion among Cesar and some other folks in Brazil about the origin of this concept (and thanks to Google Translate, I was able to follow the conversation -- the internet is pretty awesome).
— Cesar Brod (@cesarbrod) March 24, 2015
That brings up the question of where this phrase originated. There's even a question that was posted on StackOverflow regarding this: Who wrote this programming saying?
Unfortunately, this was closed as being "not constructive". But through various sources (including my new friends in Brazil), I've found a couple of usages.
Usage: Damian Conway
Perl Best Practices, 2005
Damian Conway uses the following version in his book Perl Best Practices (on Page 5):
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.He does not give an attribution here (unfortunately). You can find this quote with a Google Books search.
Usage: John F. Woods
John F. Woods uses the following version in a post in 1991:
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. Code for readability.From Google Groups
Another variation that I've seen (without attribution) is this one:
Always write code as though it will be maintained by a homicidal, axe-wielding maniac who knows where you live.And, of course, there is the mutation that I use in my presentation:
Imagine the developer who comes after you is a homicidal maniac who knows where you live.So there's lots of stuff out there that points to this concept.
Someone forwarded me this tweet. I haven't seen this one before:
A little bit of digging says this is from an unattributed sig that Martin Golding used in 1994. So similar to John Woods' sig above but a few years later.Words to live by! pic.twitter.com/FCed0Xbqno— Chris Swain (@chrisaswain) August 27, 2015
Another attribution to Martin Golding. Can anyone confirm this? Martin?
OK Internet, Now It's Your Turn
I would love to give proper attribution to the concept of the axe-wielding, homicidal, violent, psychopath, maniac developer.
If you know the origins of this concept (or you have some references that point in the right direction), leave them in the comments. And if you'd like to claim credit yourself, that's fine with me. Just make sure that you provide some references that we can check out.
In the meantime, write code to keep the homicidal maniac happy.