How do you guys be able to study for 9 hours straight without falling asleep or getting out of focus?
thats a myth my friend. Can you play/eat/run ..... for straight 9 hours ?? There are people who can focus for a long duration of period but they are few. Most of us cant do an activity over a long duration of period without taking a break unless you are in the flow or doing something you truly love but even then u need breaks. Lets say you start doing something for 9 + hrs trust me you will break down in under 2 weeks. The burn out will be bad. Instead of focusing on the number maybe focus on the journey. Instead of focusing on the numbers truly understand what you are doing. Similarly, with programming, understand what you are doing instead of forcing it into hours. You are going to exhaust your brain. You will get tired out and your cognitive function will slow down. I used to code for long hours and shared the same mentality as most of us do when we begin this journey (being over ambitious), until only recently few months back I felt the burn out. It really exhausted me and broke me down.
If you keep on forcing yourself to program for long hours you will start to hate it and even if you don't end up loathing it I am 100% sure out of that 9 hour session you logged in, only the first 2-3 hours would have been useful before your brain cries out "ok I am done and out......". For the rest of the hours, what happens is that you end up wasting your time staring straight at the screen, struggling to understand whats being said and end up running through alot of rewinds and replays before you finally mange to digest the video being played or content being read or lines being code. You also end up forgetting nearly all of it the very same day.
Given that you are working 9 hours is impossible, however if you are a student maybe you can bring in around 6 hours. However, break your 6 hours into sessions. Like each session being a 2 hr long session of programming, so you end up havin 3 sessions. Between the sessions maybe nap, get a workout in, chat with your family/friends or just go outdoors, feel some sun, or maybe chip in, an episode of a tv series in between if your eyes aren't weary. Even within each session take mini 5 mins break after every 30-40 mins.
BTW have mercy on your eyes lol. Eye wear out is a real thing hahaha.
Take it easy everyone, dont overdo it