Be nice when you code
Code doesn’t exist in a void. It’s meant to explain to a machine, as much as possible, what real things in the real world should happen. The machine will always reliably run what you want it to run. But it will never, ever, ever go beyond what the code tells it to do. It can’t.
Code interacts with humans:
- the humans that run the code to achieve a result,
- the humans that need a service that is run by the code,
- the humans that rely on the code to tell them when something’s wrong,
- the humans that are impacted by the decisions it takes,
- the humans that need to maintain the code,
- the humans that need to add a feature to the code, etc.
All of us interact with code all the time, whether we’re working on it or using it. Us, humans, is what we developers must keep at the forefront of our minds when coding. Because the code we write embodies the empathy we have for our fellow human beings.
All the nuances, all the real-life intricacies that code must deal with cannot emerge magically. It is down to us to make them appear. Every piece of code contains a partial, imperfect and limited model of a small piece of reality. Building the right model requires as much empathy as we can muster for the humans that will interact with our code. Can our code be understood ? Can people read it and be convinced that it works correctly ? Will it be easy to change when change will be needed ?
What will our code be used for ? Who will use it ? Will they feel happy and confident when interacting with our code ? Or will they feel frustrated and worried ? Will it solve problems for them, or create new ones ? In the end, the emotions that we are responsible for as developers are central to the quality of the code we produce.