Coder's block

#devjournal, #productivity, #beginners, #motivation

I often find myself in a state where I simply can’t code. You can call it procrastination, I prefer the term coder’s block as it makes me feel less guilty about it. But the truth is it happens every once in a while and I don’t like it.

Throughout my career I’ve always strived towards perfection: I’ve received incredible praise for my work, job offers were lining up and when things weren’t going perfect I was falling into a deep hole of self-loathing.

And now here I am again, desperately trying to push my productivity up and finish the work I can no longer postpone. The saboteurs at the backseat of my mind keep telling me that I’m a fluke and a failure: for not being able to concentrate and just get the job done, for starting something just to drop it in the middle of it and lots of other nasty things.

And they are right about one thing: there’s a pattern here and I am good at recognising patterns and working around them.

Block vs Flow

Why am I sometimes in the flow and other times I can’t write a single line of the most primitive CSS?

One would suggest I lack motivation, but I’m well aware of the benefits I will receive once I’m finished: be it praise or monetary reward.

Can it be the opposite? Am I not afraid enough to fail? No, I am terrified of being seen as a failure, of letting people down, of making there lives harder and disappointing them.

Truth is: I just don’t want to do this particular task at this particular moment because I want to do something else. I am motivated, but towards completely different objective that feels more important, rewarding or simply more fun.

When my motivation and task align - I’m in the flow and everything is easy and fast. Otherwise there’s an internal conflict of interests and I end up playing tug-of-war with myself until one side gives up.

Resolving internal conflicts

There’s a great approach that I’ve learned recently called non-violent communication. At the core of it is the concept that humans are wired to be compassionate and the violence stems from unmet needs as a defence mechanism.

Looking for the underlying needs helped me tremendously in interpersonal communication and I thought I’ll give it a try to resolve an internal conflict too.

The process goes like this: identify and separate facts from the feelings, then discover underlying needs and finally come up with potential actions to satisfy those needs.

In my case I have an incomplete task at hand and I can’t seem work on it for more than 5 consecutive minutes. I feel boredom and shame. I need a sense of challenge because professional growth is important to me, and I am ashamed because I value reliability: it’s important that I feel confident that I can fulfil promises I make.

So what actions can I take to ensure that my needs of professional growth and relatability are met?

The last one is “easy”: I have to finish the task and find ways to avoid similar situations in the future (hence the research article).

But how can I get professional growth from a boring task?

The place one is least willing to look

Growth stems from creativity: from trying something new and unexpected. Coincidentally (not really) new and unexpected kills boredom. Unfortunately, it also requires change and a change is uncomfortable and even stressful as leaving the safe space of our settled beliefs is not much different from leaving our home and going on an adventure.

When I started this task, I had a plan B: this exact form has been implemented already, but the code was messy and used some quite outdated libraries. Merging the old with the new is something I have never done before: I’m an adept of napalm refactoring (as in rewriting from grounds up rather then dealing with imperfect code). And there I have it: an opportunity to grow, to be less judgemental of code that just works and to incorporate outdated code into a fresh and modern tech stack and see if I can make it not only work, but make it beautiful.

Once I’ve come to this realisation I got an incredible surge of desire to work on the task I loathed a moment before. I’ve dropped this article at that exact point and dived into it.

I’m happy to report that one hour later I had a working prototype of the page in question, allowing creation of JSX components from Pug templates and I couldn’t be more proud of this solution. Can’t wait to show it to my teammates! It might make their lives easier as well!

Thank you for reading! Would you mind sharing what are the coders blocks that you’ve overcome and how?