I'm not saying the total summation of hours you code a day. When you really sit down to write a code for a particular task at a moment, how many minutes/hours (at worst case) do you normally sit down before you get tired? I know some take break, some say it depends on the task or the individual, I would love to hear them all, and what you do to keep your brain refreshed before getting back to coding. Thanks...
Maximum of three hours. I usually spend a lot of time preparing, reading, and planning. After completely understanding what needs to be done, I start writing code. Before starting my day, I think about what needs to be done today. Then after exercising, refreshing, eating breakfast, I start preparing for the project. At 12:00 pm I start writing code and after lunch, I take a nap. A power nap makes me refreshed but I don't write code afterward. I just read and write till dinner.
Hi Jimoh,
I truly believe, that it depends on how much you really love the current task. I get mentally tired quickly (~2 h), when I need to implement a yet another "contact form", but I can get carried away and can easily work 12 h non stop on my hobby projects or other interesting opportunities. Regular breaks are mandatory though - for me it is a cigarette.
Typically if I am in a groove and really want to finish up the work, I can sit down for 2-3 hours straight. But sometimes, it is not more than 30 minutes of coding and then taking break to rethink.
That's a great question!
I used to work in-office either as an employee or as a contractor, and I would regularly sit for 4 hours at a time bashing away at the keyboard, with small moments where I get up to get a drink or go to the bathroom, but I'd consider my 'session' length as half a day, split by lunch.
Then when I began freelancing I think It would get even longer. Sometimes I would work through the night, sometimes I could challenge myself and take a 12-hour block and see how much I could get done, so I know sometimes I was sitting doing the same thing for 4+ hours, maybe even double that regularly. But that's not healthy or sustainable.
I think now I spend a lot more time working, but I have much shorter sessions - 15 minutes, 30 minutes, 40 minutes, and hour or two. But rarely do I have a 'session' of work longer than 3 hours without being split up either by travelling, doing chores or running errands, meals, etc. And I feel more productive (overall) than when I used to sit and work for longer sessions.
My personal theory is that creativity is like a well full of water, and it replenishes slowly when you are inspired. So if you're building and creating things that takes energy out of you, and it takes time for you to recover before you can do that again. When I was doing those long sessions it felt like I was super productive, but I wasn't super productive like that every day, especially not after a big day.
Get up, move around every now and then, and try to let your work sessions be punctuated by little breaks so you can keep agood momentum overall :D
If you mean absolutely no breaks whatsoever as one session, then on average probably 30 min to 1 hour. If in the flow, sometimes longer. Usually small breaks can be good also, especially when nature calls or coffee cup is empty.
Vijay Thirugnanam
Inference Service @ Cerebras
I work between 1-2 hours without a break. And do that 3-4 times a day. Pretty long day for an engineer working in India. My recommendation is for people to work only 30 hours per week with 3-4 sessions of 90 minutes work per day. Keeps you productive and makes coding fun. And since I prefer to code till the age of 70, I can do this for long term.