Practice all the time
The problem ...
After three days without programming, life becomes meaningless.
Some of us would like to program all the time. I certainly had that phase for years. It can help grow your skills for a small price of health, loneliness and burnout. But non-programming activities were boring and felt like a waste of time so I paid the price.
That was stupid tho as if you really like programming you would probably want to do it for many years and this strategy is not sustainable. But if you want to practice programming all the time anyway and you despise not doing it I'm here to tell you that you can.
... was my attitude.
It is possible since you can practice in many ways and there is more to programming than just writing code in front of the computer. Also there is a carry-over effect from other activities and your brain needs time to consolidate information.
Especially the latter makes noticeable difference. Try using the new library right after reading the documentation the first time vs the day after. When I discovered that effect I intentionally started to read documentation or new codebase right at the end of the work day to give my brain a lot of time to digest new information before I use it the next day.
But breaks sound contrary to the idea of practice all the time
so
what is:
The answer ...
At certain level of skill everything you do matters. So to advance your programming and be able to do it for many years you actually have to put conscious effort not only into code but also into improving your sleep and diet. You have to exercise and learn to rest. Even the ability to have fun and spending time with friends and family matters.
This mindset will allow you to focus on other activities as you will no longer despise the time away from the keyboard but view it as a training of certain programming related skill or preparation for next coding session.
At first I thought that it matters less when you are younger since you have less worries and your body is more resilient. But now, as I managed to start a few new skills at older age, it seems that it's not the age that matters but the advancement of the skill you practice.
The athletes know that. It's obvious to us that they have to watch their sleep and diet - even at a young age. That they need mental focus and stability to be able to concentrate on their training and competitions. But surprisingly it's less obvious when it comes to other disciplines.
... how to live?
Don't waste time tho. The above doesn't mean: spend less time programming; but: consciously focus and improve on other aspects of your life in order to help your programming practice.
Use your time well. Have a book about programming to look into while on commute or waiting. Read it before sleep instead of the internet's noise. Talk about it with others - even non-programmers. When at the computer do the actual programming. How much of your screen time you spend coding? Notice that programming is a mental discipline so you can actually think about possible problems and solutions, architecture and algorithms while walking or bathing.
Writing code requires long spans of focus and concentration and you can practice those with anything you do. When spending time with friends and family practice active listening and reasoning, connecting facts and precise articulation of thought. Have fun and relax but pay attention. Doing that you will at the same time take break from reading documentation and codebase giving your brain time to consolidate new information, and you will be practicing skills useful for your work.
Plan your days, workouts, bedtime, meals and train discipline by following
those plans. This will help you with planning at work and following the plan
through. You will learn what amount of work is possible to do, how to
prioritize and to say no
to less important matters. It will keep your
body healthy so you can sit without back, neck and elbow pain and do it for
years. Also not getting sick thanks to frequent exercises and sleeping well is
a huge time saver.
Discipline your mind and body as much as your everyday life but don't be tense all the time. Learn to relax in both to recover so that you can demand from yourself more when coding next time. Putting effort in areas outside of programming will always somehow help you with your craft but will also teach you how to put more effort into programming itself when you do it.
The new way ...
There is no denial that in order to be good in any skill you have to put many hours in it. So make plenty of room in your schedule for programming. But the quantity without quality is just a waste of time. Frequent, focused and deliberate practice will allow you to achieve more than simply being in front of the computer all day long everyday.
Again: how much of our screen time is actual programming practice? Incorporate a simple 30 min walk instead of mindlessly watching programming tutorial and then go back to coding with full concentration and clear goal.
Also try to focus on learning fundamental and universal skills before
jumping into very specific technologies. Learn how computers and operating
systems work, what compilers do and how memory works. Do that before jumping
into new framework which will be outdated as soon as you master it. Those
boring
skills will always be better time investment and have broader
applications.
... of practice.
Practicing stillness is good for the movement as every step we take is possible only through the firm support of the non moving leg.
Next time someone asks how are you able to do that many push ups answer that they have to do a lot of programming. If they ask how to be as good a programmer tell them to do more push ups or to go for a walk with friends.
Practice everything all the time - improve your life - improve your programming.
Thus spake the Master Programmer:
"Time for you to leave."