CBT in software development

Since I haven’t written anything for two weeks, I think it is time to put some thoughts on paper, even though I don’t have anything particular to write about. There is one thing that comes to mind, and it seems relevant to coding.

Recently, I’ve become interested in psychology and how we can either control or regulate our moods, automatic behaviour, and feelings. After a quick look at different schools of “fixing the mind”, I decided to have a closer look at cognitive-behavioural therapy, which seems very promising. In a nutshell, it focuses on paying close attention to our moods and analysing their accuracy. Once you evaluate how accurate your reaction is, you can then take action, either accepting it or trying to change it.

While comparing this to coding, I want to focus on the first part, although the actual reaction can be applied here as well. Often, we are under a tight deadline. We need to ship working software now, or we believe it’s necessary to do so today or even yesterday. Then we reach a stage where we stop analysing the situation and write whatever “works,” hoping it will get through. There are two serious problems with this thinking. One is that most likely staying long hours and patching everything together won’t lead us to the desired solution, and the second is that in 99% of the cases, it can wait until the next day, when, with a clear mind, we will solve the problem. I’m not saying to leave everything for tomorrow, but take a moment to reflect on our current thoughts. Then analyse how accurate it is. Then see what we can do about it. Sometimes accepting the consequences is better than just pretending everything went smoothly. This applies both to day-to-day life and programming.