In same way that sleeping 10 minutes less each day leads to you not needing sleep at all or showering at 1 degree more each day makes you impervious to boiling water. So, no, absolutely not and potentially dangerous to your health.
You can do that in short term, the real problem is usually when I tried that for weeks.
Some amount of downtime is necessary. Now I intentionally take breaks and exercise a bit in between coding. The exercise actually helps. With breaks you gotta measure them a bit tho, else you risk taking too long breaks too often.
- I'm working on something I'm interested in
- I feel like there's upside for me if the project succeeds
- I can work in different places throughout the day, like my desk, my sofa, in another room, etc. Not really possible in an office
- It's a quiet area where I won't have people interrupting my flow state
- I'm not blocked on things I need to know
- I'm working on something that's been de-risked. I know what I need to do and I know how to do it
> - It's a quiet area where I won't have people interrupting my flow state
It's amazing how much an office fights against productivity.
But the office has upside when the task is not well defined or I work on a lot of small stuff. At home, my brain will wander around more easily between context switches.
Thanks for including this one. I think the biggest stresses in my dev career have come from times where I didn't really know what needs to be done or when I was way out of my depth. I believe this reason alone was a huge driver of my procrastination in the past, especially when I was the lone programmer on the project.
An example of this is when you do pair programming, your pair forces you to keep concentrated (and you force him too) - if you are screensharing you won't alt tab to reddit) so it's an example on how you can keep focused for longer periods than normal, at the expense of being more tired at the end of the day.
No matter how much you force yourself you can't just force yourself not to feel exhausted/restless/depressed or whatever else is effecting your productivity, you sure can alleviate these symptoms, but that's improving your well-being generally rather than forcing yourself to be productive.
So it sort of depends what you mean by force, I'm guessing it would just cause you more stress and make you eventually burn out because you're not in reality becoming more productive by focusing more, you're only stressing yourself out further.
I don't think working 8 hours of productive work will get you to burnout. It's more a matter of habit and discipline and interest in the project.
In my experience, what leads to burnout is a bad working environment and/or working a lot for long period of time.
Write test for everything, don't do manual testing. If the test is green my code is good. Don't spend time manually testing your code.
Touch typing was a huge improvement. I'm not a fast touch typer so it wasn't really improved my typing speed. It's more of that I outsourced my typing from my brain to my hand, so while I type I can stay focused on the problem.
The whole point of this is that it's not a binary state, and it's not "writing code". So, tl,dr : no, it's not because you are most likely not the bottleneck. You are not the master of the cognitive overload you operate in for instance.
Is it possible to improve this by training? For example if I'm productive 2 hours and force myself to be productive 10-30 more minutes each day for a number of days and when I'm comfortable with 2:30 hours of productivity, force myself to be productive for 30 more minutes. Would this eventually lead to 8 productive hours? Or is burnout (or another complication) a more likely outcome? Has anyone tried this?