How do you consistently coding/learning to code for more hours everyday?

Hey guys I am just here to share/ask something will y’all.
I have been learning to code for like more than a year.
I am at a point that I have a lot of free time everyday, and there is nothing I need to do or distract me.

But I am at a point that whenever I code for too long (sometimes not even coding, but just trying my best to understand coding concepts and code snippets from books like YDJKS), whether it is js or just plain HTML and CSS, my brain just stopped working. Like it refuses to listen to me. Sometimes it is an hour (most of the time it is one hour exact) other times are 2-4 hours. (but this is really rare I can only code for this long whenever I am doing a new static site in HTML and CSS.cos I am really excited for the new project and time flies through when you concentrate)

And after that point (1 hour) whatever I am trying to learn I just can’t. However if I try to understand the same topic the next morning, it goes really smoothly and without any hiccups.

The question I want to ask is, how can I increase the hour I am learning at the same time avoid burnt out?
I want to be able to sit at my desk and code for 4 hour straight. I hope I can do 2 hours of HTML and CSS mock ups, and 2 hours of understanding js through YDJKS.

How long do you guys normally gets burnt out when coding ? Are these feelings gonna go away?
I heard some experienced devs talked on youtube when they said they have a lot of other obligations in their real job. For example like meeting with team members, meeting with clients, revising old code/debugging, and then at the end actually coding. And one of them said on a typical day , the amount of time he actually sit still and code is around 4 hours+. After that you are just getting diminishing returns.

I know we all see millions of articles on medium that said : how I become a dev within X period of time and how I spent 8 hours a day coding non-stop for a year etc etc.

But for me I don’'t plan on shooting the moon. I only hope I can code consecutively 4 hours a day. 5,6 days a week. Is this too hard to do so?

1 Like

Ok, so your approach is incorrect. You need to code through 45 minute increments. Do it like this:
45 minutes - HTML
15 minutes - Quick walk or snack
55 minutes - HTML
5 minutes - Bathroom Break
45 minutes - CSS
15 minutes - Quick walk or snack
55 minutes - CSS
5 minutes - Break

Thats how you cover a distance of time. You need to give your brain a break. Remember your brain is not programmed to code for 4 hours straight, take five or fifteen minutes of a break between the sessions. That gives you time to relax and think.

BTW these feelings will never go away. Just take breaks and relex.
Hope that helped?




i see. i think for me the important part is to control those breaking period tightly…
sometimes once I dive into reddit… lol… half an hour passed already.

combined your solution and @PortableStick 's solution.
i think I know what to do already.

also for anyone who is trying to use the same technique.
here’s a website for it.

To add onto what @SamiTheNerd posted, you only need to do a little bit every day. I mean, if you can actually get 4 hours done every day then that’s great. In the sense that the more time you put in, the better. But you shouldn’t feel like that you need to put a certain amount of hours per day—as long as you can put in some amount of time every day, even if it’s just 15 minutes, that’s better than nothing.

But not only does your brain need a break throughout the day, it needs a break every night, and you need a good night’s sleep in order for it to absorb what you learned that day. It’s one of the reasons why it’s recommended to not stay up all night—your brain actually retains information while you’re sleeping.

Also it’s recommended to not be sitting for extended periods of time anyway, as sitting is bad for your health. You should be getting out of your chair at least once every hour to prevent those physical negative consequences.

1 Like

Have you tried joining the #100DaysOfCode Challenge on Twitter I know it has really helped me to keep up with coding everyday and making progress is all of my coding challenges. And even Quincy wrote an awesome Medium article on it. But other than that like people said try to take small breaks while coding. :sunglasses: :+1:

1 Like

It really depends on what you’re trying to accomplish.

When you’re learning, you are going to mess up and create bugs… a lot. Sitting in front of a computer repeating the same debugging step over and over again hours on end isn’t going to do much for your learning experience. Build character maybe, but far from retaining any information. It’s much better to use the pomodoro method having shorter work intervals and big rest breaks to think about new information you’re learning.

Building a product and implementing a feature is a different story. In this case, you got an idea what you’re doing and much of the learning is more fluid given you’re adapting to some one-off dependency. You can sit in the chair and crank out some code much longer and not need to rest as long since you have more unconscious competence over your programming language of choice.

My rule of thumb is if you’re spending more than 15 minutes going nowhere with an aspect of your application, it’s time to get up from the chair and walk around.


thanks i will keep this in mind.

I strongly recommend alternating between sitting and standing when working and studying. Sitting for long periods of time is awful. I bought this awesome motorized desk a few weeks ago (it goes up and down at the push of a button) and it has changed my life. I want one at my work now. You have so much more energy when you allow blood to flow freely through your body.

1 Like

i see… thanks! :sun_with_face: