There are many ways to boost your productivity: time management, prioritization, reducing distractions and so on. But there's one unconventional way that can make a huge difference. In this brief article, I'll show you what it is and how to implement it.
So... what is it?
The unconventional way to boost your coding productivity is to... do some physical activity. It might sound strange, but there're numerous studies that show that physical activity can improve your cognitive functions. Here is a great article that goes into details. Of course there are also other benefits of working out - better mood, better health, better sleep and many more.
My experience
A few years ago, while I was studying for my exams, I found out that I could remember things better if I did low-intensity cycling while learning. I was quite surprised, but I kept doing it and it worked. Then I also tried to work while cycling and... it worked as well. I can focus better, I can think more clearly and I'm more productive when I combine programming with physical activity.
However, there are some things to keep in mind. First, it's important to keep the intensity low. High-intensity workouts are great, but they should be done separately from learning or working. Second, people are different and what works for me might not work for you. But it's definitely worth trying.
How to start
The first thing you need to do is to find a sport you like. There's no point in doing something you don't enjoy. Then, don't invest too much money at the beginning. Sure, 15,000$ bikes are awesome, but you don't need one. A more basic, perhaps second-hand bike will do just fine. Same thing with other sports - don't invest too much at the beginning. If you like it and you see that it helps you, you can always invest more later.
A common mistake is to start with high intensity. Beginners often can't judge the proper "low intensity power" and they end up doing moderate-intensity workouts. That's not what we want in this case. You should be able to talk while working out. Being able to nose-breathe is also a good indicator, as long as your nose is not blocked. The simple advice is: start easier than you think you should and when in doubt - go easier. In this case there's no harm in going too easy, but there's a risk in going too hard. Your fitness will improve over time and you'll be able to do more power soon.
After a few workouts it's time to determine whether it works for you. Does it help you focus? Do you feel better after the workout? Do you feel more productive? If the answer is yes, then keep doing it. If not, then it might not be for you. But in this case I'd still advise to keep working out - just not while learning or working.