DEV Community

Akshay Varshney
Akshay Varshney

Posted on

How do I maintain consistency to focus for at least 1 hour in coding every single day?

As a beginner in coding, we struggle a lot to build consistency, and due to which we lost our pace. In the start, things look favorable to us so we did it consistently but when things become slightly complex we start losing our way. I also struggled a lot to build consistency and it's ok if you also do. Coding is like a marathon of sprints. I think there are a few things that we need to understand while studying coding.

I would recommend everyone to follow the 100dayofcode challenge. But the question here is How to focus for at least 1 hour/day continuously and that too for 100 days?

If I plan to have a long coding session for around 3-4 hours continuously then after some time I will definitely get bored with my studies and I may start to play movies, start thinking about something else, or maybe start checking social media. It's like I study with my laptop open but my mind is somewhere and this was really the root cause of my problem. What is the threshold? what should be enough for me. So I have to identify this threshold limit. But how to identify this limit let's find out...

Building 1-hour consistency at the very start is not an easy task. So what I used to do is I started with short sessions. Like I do coding for around 30 min then I take a short break of 5-10 mins then come back for another 30 min. In this way, at my initial stage, I completed 1 hour. After around 7-10 days when I start to feel comfortable, I kept increasing my timelimit by 5 mins until I reach my threshold. I have 2 sessions of 35 min followed by a 10 min break in between. In this way, I am tricking my brain to get comfortable with coding, brain now coding is your thing & you have to learn it so please cooperate. Follow this until you find your threshold limit.

If you start directly with 1 hour then I know we will be able to focus for the first few days but after some days when things start getting out of our way, we start losing consistency.

When I am sitting down to study I have some specific rules.

What are my rules to study?

  1. I am working it means I am working period. Not allowed to do anything like I kept my mobile phone in another room. Turn off email, social media notifications from the laptop if possible.

  2. Plan to start with a short 30 min session then start adding the time until you reach your threshold. My threshold was 1 hour 20 min.

  3. If you have a break that means you have a break, no coding in your break. Like, suppose 30 min is over you should get up from your desk and do what you want to do in your break. It's like forcing myself to step away from the screen when the break starts.

  4. Decide what time you will sit for study. Try to follow the same time for a few days and after some days it will become your habit. My time was 8:00 AM- 9:15 AM & (9PM-10PM)

  5. If you find to struggle a lot with the motivational side then start Listening to some podcasts when you get time. I don't know but listening to them will give me some energy and I feel energetic.

  6. If possible try to have some meditation or yoga before your study session.

  7. Whenever you get the free time it doesn't mean that you have to think about coding all the 24*7. Try not to think about code each and every time your brain will break down. The brain is only a muscle so it also needs some time to relax.

  8. When I get bored with my regular studies then for a change I used to do some side projects as my hobby. Like I was learning DSA, whenever I feel too tired to do DSA and feel like not studying I move to my side project. This will give me a change and the next day you can pick what you were studying with much more energy.

  9. Sharing progress with someone will give you motivation. Strongly recommend sharing your progress with friends or on Twitter/Linkedin. Don't think about what other senior developers will say.

  10. No longer distraction, Simple to understand but harder to implement.

  11. You should enjoy the process of coding.

  12. Set goals for every single day. Make sure your goal should be realistic.

By following this process after around 1.5 months I was focused to do coding for at least 1hr each day

Some reasons for your struggle:

  1. Don't go for a longer coding session in a day and skipping the next few days.
  2. Try not to think about code each and every time your brain will break down.
  3. Unclear boundaries between work and break.
  4. You enjoy coding but don't enjoy the process it could be a lack of boundaries.
  5. You have unclear goals or your goal are unrealistic.
  6. You are working with a lot of distractions.

It's all about tricking your brain to learn discipline. Hope this will help you reach where you want to go. You can apply this to whatever you are learning if it works for me then it will work for you as well.

Happy 100daysofcoding...

Thanks for reading :)

Top comments (12)

Collapse
 
paritoshdadhic2 profile image
Paritosh Dadhich

Thanks for giving these important tips especially sharing your progress with your friends, and on linked on/Twitter.
Take small breaks after 30 minutes of work without distraction.

Nowadays, I am also doing 100daysOfCode. I'll surely keep in mind these tips and tricks while solving questions.

Collapse
 
nazanin_ashrafi profile image
Nazanin Ashrafi

Pretty awesome article and solid tips thanks Akshay ๐Ÿ˜๐Ÿ™Œ๐Ÿ™Œ

I strongly recommend sharing your progress. I always share my work with my friend and his support boost my confidence and energy to keep going

Psst your article inspired me to come up with a new article idea ๐Ÿ˜๐Ÿ™Œ (it's somewhat similar to yours tho)

Collapse
 
akshayvarshney6 profile image
Akshay Varshney

Thank you so much, Nazanin :)
Great you rocks.
ohh You got the idea as well so I guess a few new articles would be coming from your end. Nice

Collapse
 
ritvikdubey27 profile image
Ritvik Dubey

I'm struggling with consistency now a days, I'll surely give it a try.!๐Ÿ™Œ

Collapse
 
akshayvarshney6 profile image
Akshay Varshney

Thanks, Ritvik :)

Collapse
 
irshadmir profile image
Irshad Ahmad Mir

Same here bro...

Collapse
 
rakesh profile image
Rakesh

relatable and insightful..good read akshay

Collapse
 
akshayvarshney6 profile image
Akshay Varshney

Thanks a lot, Rakesh :)

Collapse
 
realtoughcandy profile image
RealToughCandy.io

Excellent rules here. My favorite is leaving your phone out of sight.

Collapse
 
akshayvarshney6 profile image
Akshay Varshney

Thanks:)
That is the most beneficial one and also the most difficult one to implement

Collapse
 
jyotijauhari profile image
Jyoti Jauhari • Edited

Insightful article! I will try to follow this ๐Ÿ’ฏ.

One more question, how you prepared for cs subjects that are asked in interview like DBMS, OS, CN and how much time it has taken for you to prepare it?

Collapse
 
irshadmir profile image
Irshad Ahmad Mir

Very informative and beneficial article..