Thursday, April 21, 2016

Cognitive Dissonance: How I learned to like programming

A remark in an online lean coffee caught my attention: "I don't write automation. I really don't like that work. And there's N developers and just one of me, so I leave the code for the developers".

It could have been me speaking. But it wasn't. It wasn't even someone who has been around me to learn to speak like me. But hearing something I recognized so strongly made me feel the urge I need to share my story of how things changed.

Rewind back a little over a year, and I would have sworn I will never be a programmer. "I really don't like that work" would have been exactly my words. Someone suggesting I could try that would be met with skepticism. You can probably find me saying that in public in this blog that is intended to keep me honest to myself - if you get something out of it that's a plus.

I started mobbing not because I wanted to learn programming, but because I wanted my team to work better together. I wanted to feel my social needs met at work. So in hindsight, little did I know about how the human mind works.

When thinking of changing jobs, I had an interview with a psychologist. Me mobbing with my team was one of the stories I shared with him, and he labelled what might have happened: Cognitive Dissonance.

Cognitive dissonance is a state in which our beliefs and actions are not in aligned. People have this habit of needing feel whole and consistent, and we do that to the extent of rewriting our history and perceptions.

If my foundational belief is that I don't really enjoy programming, I seek to not do it - after all, I believe I don't like it. Theories around cognitive dissonance seem to be saying that we change our beliefs from dissonant actions - not the other way around. When I do something that is against my belief system, it starts a process of rewriting parts of my belief system.

With mobbing, this happened slowly. After all, we were mobbing at most once a week in the office. The extra sessions to learn the teaching technique I organized with the local tech community added some. I always told myself I had other motives to join the mobs, I never really cared for the programming part of it. I wanted developers to learn testing. I wanted to see if I could think fast enough to spot problems without the product as my external imagination. I wanted to see if I could use mobbing to teach my exploratory testing skills to other testers. The coding was just something I had to endure.

But over time, my feelings changed. As I did more of the programming in the mob, it wasn't just that I became more confident with the things I already knew as technical non-programmer or that I picked up pieces while we were doing it. My attitudes started to change, impacting my belief system that I used to define my place and role in the system of creating software.

I went from "I don't write automation. I really don't like that work." to "Let's write some automation. But why focus only on test automation, we have a bigger problem to solve with thinking around code".

My claim is that convincing me on this in advance would have been close to impossible.

So think about it: how could you use cognitive dissonance in giving yourself a chance to change your fundamental beliefs by engaging in work you feel you don't do. Or even more: could you use cognitive dissonance in changing the mind of that difficult developer who never wants to create any unit tests?

Experiment. There's a lot of power there.