Empathy in programming is a two-way street

Hot takes about how hard to read code implies a lack of empathy have been widely shared, but this only betrays a lack of empathy on the part of those readers and contributes to the stigma of mental illness in software development.

Recently I retweeted the following from Michael Feathers:

I can tell whether you have empathy by looking at your code. @mfeathers 2018-08-19 15:44

I didn't think much of it - I just took the meaning that when you're writing code you should put yourself in the shoes of those who have to work with it later, and moved on. Then a respected colleague came and told me he disagreed with what I'd retweeted, and why, and he was quite right, so I undid my retweet. I considered tweeting something about it, but others already had covered most criticisms in response to the original and I didn't need to invite arguments.

But it must have been rolling restlessly around in my mind in the meantime because at the weekend it came to the fore again and I realised something about it that make me uncomfortable and that I want to expand on.

The original tweet comes with an implied criticism about a lack of empathy. The author is saying hard-to-read code implies a lack of empathy - and that a lack of empathy is inherently bad. If that wasn't the implication then the tweet would make very little sense; it would certainly be very weak and unlikely to gain so much traction if the only meaning to take is a general observation about how much people think of others when they code.

A lack of empathy is often associated with categories of mental illness and disorder, including depression. This isn't to say that depression always comes with a lack of empathy, but a severe depressive episode may well involve it. Autism is often thought to involve a lack of empathy, though in reality it is more complex than that.

Importantly, none of these things are the fault of the accused.

Pretty much anyone can go through bouts of depression, a debilitating condition over which there is little control to exercise. Similarly, people with other disorders that can impair empathy may find them ebbing and flowing through periods of more or less intensity. Our mental health is not a constant through our lives. And this is not to say that those who have a condition inherently impairing empathy should be considered lost causes.

I don't believe for a moment Feathers is consciously propagating stigma around mental health in our discipline, but that doesn't mean that others don't. Another tweet I couldn't let slide in recent months came from an apparently fairly well regarded developer who in the course of a widely shared thread declared that people with social anxiety should not be software developers.

Social anxiety really can be quite debilitating - I know this first hand. I've struggled with it on and off pretty much my entire life, only realising in my mid 20s. It has harmed my friendships, relationships and even my career (I once let a potentially very good job opportunity go because I couldn't bring myself to answer the phone for a few weeks, eventually politely turning it down just to get out of the situation). But with support and understanding I've managed to limit that damage and be, I believe, at least somewhat effective in my job, especially in recent years.

And there's the crux; shunning those with these problems, telling them software development isn't for them, isn't the kind of positive, inclusive action we should be taking. We need more compassion, less of the dog-eat-dog puritanical capitalism which infects Silicon Valley and start-up culture. Support and understanding for those with temporary or permanent mental health issues (and those who are struggling for other reasons) is our duty as human beings, and that can also mean minding the language we use so as not to stigmatise.

We could start by realising that empathy is a two-way street and not just exercise it when code is written, but also when it is read.

Deanna Troi leaning on Data's shoulder from the Star Trek: The Next Generation episode "Tin Man"

About

Jim Kinsey is an English software engineer based in Berlin. Currently at Springer Nature, formerly of BBC News & Sport.