Code The Flow - How To Write Code In More Productive And Fun Way

Spend less than 2 minutes to discover three simple tricks that will help you to be in the coding flow! Write the code in the more effective way. Code with better quality. Be more satisfied with the time spent on programming.

One little thing aka single responsibility principle

Have you ever heard about Single Responsibility Principle (SRP)? It states that there should be only one reason to change the code of a class. If there is only one reason to change, it means that this class has only one responsibility. It is doing one simple thing.

SRP can help us to be in the flow. When writing small classes with a simple purpose, you know exactly what to do. It helps you to be present - you have only one next step - write this simple class with the clear goal of existence. Since it is just a simple class it makes you confident that you can accomplish this task.

Behaviour Driven Development / Test Driven Development

One of the biggest obstacles to being in the flow is uncertainty. You can avoid it by knowing two things: how your software behaves with user interactions and what results it should return.

In one sentence: write your tests before you start writing the code.

What is more, tests can help you focus on the next step that has to be done. You just concentrate on the current reason why the test fails. It gives you instant feedback what is working and what is not.

Pair programming

Coding with someone else is another way to receive instant feedback about our ideas and code. The second coder immediately shares with us his/her opinion. In this way, we can make an improvement and solve the problem better and faster. It also helps both programmers to focus on the task. We have the same goal. We motivate each other to focus deeply. Human to human interaction helps us to forget about the outside world.

Summary

With these 3 simple techniques of coding, you can activate 4 out of 7 flow factors. As usual I recommend you to implement them one by one. Make small constant changes that will improve your productivity and happiness in a longer perspective.