I’ve written several articles on the technical sides of legacy code and technical debt. But now, let’s focus on the emotional side, the human factor. I’ve touched on this previously, but would like to expand on it a bit further.
Working with legacy code can be frustrating. Especially if there is not enough room to improve it. Or if there is room, but the team can’t seem to succeed in improving, for whatever reason.
Frustration that is left unaddressed for too long leads to all kinds of bad things.
Developers can start taking things personally. Any critique on their code can emotionally hurt them.
On the other hand, they might think that others are writing bad code. This is a mechanism called “superiority bias”, where we tend to overestimate our good aspects and underestimate those of others.
In a context where there already is frustration simmering, this can lead to finger-pointing, heated discussions and in a bad case, people leaving the company.
To make matters worse, you’ll lose the most talented people first, because they have less trouble finding new jobs. This leaves your team with the less skilled developers, making it even more difficult to get that legacy project back on track! This is called the Dead Sea Effect. It’s not a good situation and non-trivial to get out of.
So we started with a bit of frustration and ended up with the team falling apart. This is possible, and I have seen it, but not every situation escalates so extremely.
Regardless, the frustration will lead to personal vendetta’s, infighting, reduced productivity, blaming, and finger-pointing.
It doesn’t have to be this way. While there will always be some frustration about bad code, we can empower teams to tackles these pain points and make them approach the problems in a more positive way.
But that requires some effort from the organization and management.
Management and team leaders (and team members) should acknowledge the negative feelings that code can cause and there should be room for these emotions.
But the same leaders play an important part in channeling these emotions. This can be done by getting together with the team, acknowledging the fact that there is a problem, and providing a way out.
The way out can take on many forms, but it will take time and money and team effort. Allowing the team to take their time to tackle the technical debt is crucial. It means that team leaders and management must take away a bit of the pressure that comes with constantly focussing on new features.
With this, the team has room to breath and won’t feel stuck in a situation where the only real way out is to leave the company.