Coding with Empathy
What’s going through your mind when you’re writing code?
Chances are, you’re focused on the immediate problem your solving (And rightly so!). My hope is that once you solve that problem, you take a step back and focus on the impact your code will have on others.
Are your tests communicating their intent? Will future tests be difficult to create or modify? Has the change you’ve introduced impacted the codebase in any negative way? (Do all unit, integration, and acceptance tests still pass? If not, go fix that… now!)
Have you left things cleaner than you’ve found them? Have you paired with someone to ensure that the ideas behind the newly introduced change have been distributed in more than one mind?
If the answer is no, to any of these, why not?
Don’t you care?
Have a little empathy. Every line of code is a liability and any shortcut taken in anything I’ve just mentioned is a future pain point for you or worse, someone else. If you haven’t taken the time to keep it clean, keep it automated, and spread the knowledge, all you’ve done is create an opportunity for frustration that either you or someone else will have to deal with in the future.
Be a good sport. Have a little empathy. Try and think of the person who’ll stumble across what you’ve created and try to make them happy that you’ve tried to leave things in a place with little to no yaks in the way of the problem they’re trying to tackle.