DEV Community

Cover image for How to stay MOTIVATED while learning coding (or anything)
Thu Nghiem
Thu Nghiem

Posted on • Updated on

How to stay MOTIVATED while learning coding (or anything)

The most difficult thing for me and I guess for many as well is to stay motivated and focused. Here are a few tips for you to keep on going:

Identify your fear

Yes everyone has a goal, either it's money or happiness. It does motivate us to move forward, but if that does not scare the s**t out of you then it is NOT good enough.

Think about it: does it scare you if you failed to achieve it? will you be miserable without it?

Once you get this down. Whenever you feel lazy, remember your fears and it will help you get the lazy a** up and work :)

Give yourself a reward

Like animals, if you give them a treat, they will listen. We need some treats as well.

Instead of playing games all day or eating unhealthy food, just because you feel like it. Use it as a treat. Only give yourself that reward when you complete a task.

For example, I will give myself an ice scream whenever I complete a challenge on

Have your own treat and it will surprise you.

Put your f**king damn phone away

One of the most distracting things around you is your phone. Keep it away when you are studying. Don't open Instagram when you just wake up. It will destroy your day.

Social media is my biggest enemy when I am doing something. I am addicted to it, therefore I have to put my phone away from me as far as possible and only allow myself to check it when someone calls or when I have done the tasks of the day

Set a timer

Set a timer of 20 minutes and commit to it. Tell yourself to focus on these 20 minutes. You will be surprised how much you can do in just a short amount of time.

Set a timer for at least 2 more times a day.

Usually, when I focus on coding for the first 15 minutes, I will completedly forgot about time :))

Build a habit

Instead of studying only when you feel like, start to build your habit by picking a specific time of the day to work on it.

For example, when I was in high school, I would study English whenever I got home from school.


If you don't take the first step, it will never be the last step.

Some of you know me as the creator of I will update more useful content there, so check it out.

Feel free to leave a comment and share how you stay motivated

Top comments (2)

kyril96340413 profile image

Set a timer :D Thanks for this

lachi001 profile image

I needed this