I have two ways in which I write code and get work done.

Sometimes I’m just super productive. I don’t care about anything besides accomplishing the goal I’ve set to myself. I’m focused on a single task, deeply concentrated on the work I’m doing. I accomplish more than I expected, my work is accurate, all the edge cases are handled. I enjoy what I do, it’s like playing a video game. Before I notice, the hours pass and it’s time to stop working. I feel good after being productive and I can’t wait to get back to work on the following day and get even more stuff done. I just wrote some code but I’m proud of it as if I engineered a German luxury car or wrote a piano concerto.

I had great results working this way. Both as an employee and while building my own products on the evenings. But I wasn’t able to work this way all the time. On other days I stare at the clock and time doesn’t move. I’m thinking about other things and what I’ll do when I’m done working. I start writing code but then remember something else, I check news sites again, hoping something was updated from a few minutes ago. Eventually I complete the task that I had. I log my hours, I get paid. The development of the product slowly moves. I hate this.

It’s easy to be dismissive and say “oh some days are more productive than the others” but which part of it is chance and which part is pushing yourself to be better? I know that the “taking it easy” way of working will make me a mediocre programmer, dependent on an employer to get paid, easily replaceable.

You are in charge of your destiny

How can I make myself efficient all the time? I’ve noticed a few things that make me more productive. First is to focus on a single well defined task. I try not to start working unless I know exactly what I want to achieve and I’m sure that this is the most important task for me to currently be working on. But also most of the time is just a matter of mindset. A decision to focus and be productive instead of wasting time.