7 Secrets to Staying Motivated When Learning to Code

Published Sep 25, 2015Last updated Mar 06, 2018
7 Secrets to Staying Motivated When Learning to Code

At Codementor, we’re proud to boast 6000+ expert coding mentors to help people around the world learn to code. As a community of developers at all levels, one of the biggest struggles when learning to code is finding ways to stay motivated. We asked our mentors for their best advice to help you stay motivated, particularly for those of you who are new to programming.

Secret #1: Make sure this is actually something you want to do

There are few things more frustrating than doing something that has no point in the end.
Rick van Hattem

If coding is not something you want to do, then leave it to those who do. As mentioned in our learning hacks for teaching yourself how to code, the first learning hack is knowing why you’re doing this. When your code is in knots and nothing is going your way, those are the times when remembering your purpose for learning code will help push you forward so that you can stay motivated and ease any frustration that you may have.

Motivation is good, but not the answer to keep you going in the long run. Become passionate about what you do.
Yad Faeq

Sure you don’t need to be obsessed with all things code, nor do you need to be extremely passionate about coding from the start —these things don’t really happen overnight. It often comes after spending some time learning and understanding code, as well as creating simple things from scratch.

Secret #2: Start small, celebrate the little things, and build, build, build!

A good mentor of mine told me if you want to create a flying car, then start with making some wheels into a skateboard, enjoy the skateboard and turn that into a bike and so on.
Yad Faeq

Learning to code is super easy — said no one ever. Learning to code can certainly be a daunting task to many but one of the most helpful ways to learn and stay engaged it is to start small. What this means is that you should first learn the basic syntax of the language, then start writing some code to practice. Once you’ve gotten a hang of it, go ahead and pat yourself on the back!

self five

Take things one at a time so that you are focused on mastering bits of information or concepts. As you stack up those building blocks and celebrate those small wins, take a step back and you’ll see that you’re really onto something.

Build a personal low-risk project that tackles a new idea or puts a new twist on an old idea
Andy Maleh

Learning to code gives you the tools to build things that can potentially change the world. Build things, test what you’ve learned, and keep going at it. There are many resources available online to help inspire you, or, you can even join events like hackathons. Having a project, whether it’s all to yourself or with some friends, can be a great way to keep your drive.

Secret #3: Get a mentor

Get training or regular mentoring by an expert in the language of choice or technology you aspire to master
Andy Maleh

Most programmers can probably tell you how much they’ve gained when learning from a mentor, whether it’s a senior colleague or even an expert on Codementor. Having a mentor means avoiding those common mistakes and roadblocks that slow down your learning process. Mentors have all “been there, done that” and can provide invaluable advice and motivation derived from their real-world experience.

After finding that mentor, the possibilities for you to grow are endless. Make the most of your mentorship through pair-programming, mock interviews, or even get help to land the job. Mentors are, without a doubt, the most reliable motivators that will guide you to the finish line.

Secret #4: Maintain a Portfolio

Once you’ve built more and more things, keep a collection of your work. Whenever you’re feeling a lack of motivation, you can always refer to this and see how far you’ve come. If you’re not quite sure what you should include in your portfolio, here’s a list of the most important things to include in a web developer’s portfolio. Don’t just maintain a portfolio for the purposes of finding a job though, you should be proud of what you’ve accomplished so far!

Secret #5: Just do it. Or just do nothing.

I try to keep in mind that the shortest distance between me and my goal is just to do the damn thing.
Matthew Johnson

Sometimes, you just have to stop over-thinking and over-complicating things and just do it.

On the other hand, you can just “Do nothing about it. That’s right, forget about whatever is bothering you”, as Marcos Rodriguezsays.

Keep in mind that it’s easy to burnout after a few hours of binge-watching tutorials or non-stop programming. It’s important that you allocate some time for getting rest in order to recover and recharge. Who knows, maybe you’ll even be able to solve the issue in your dreams. (Seriously though, it happens.)

Secret #6: Balance

Sometimes it’s easy to forget that there’s a world outside of your computer, so make sure that you’re consistently taking a break away from your computer (or even from electronics for that matter). Spending a ton of time on the same issue without making progress can easily lead to frustration, stress, and eventually, a burnout. Instead, meet up with your best buddies, spend some time with your family, or anything to get your mind off of whatever you’re working on, even if it’s for a few hours. Your brain will thank you for it.

Balance by Kevin Dinkel, CC BY SA 2.0

As Christoph Wagner puts it: >Programming is a very introverted activity, so getting enough human contact can also be a challenge, especially for those people, like me, who were drawn to programming because they are themselves introverts. Making sure that I get enough social contact has been a challenge, so I started taking acting and improv classes.

Secret #7: Be a part of a supportive community

A quick search on the web and you should be able to find many communities for developers, including ones for beginners. 

For Codementor specifically, we have had a few #CodeMentor Twitter Chats on topics like Programming Languages: Which to Choose? and articles like The Worst Programming Languages to Learn in 2018 to engage with anyone who is new or curious about programming. 

Some other notable communities include, CodeNewbies, who are also on Twitter, and even female-oriented ones, such as Ladies Learning Code.

Lastly, there’s always Reddit (e.g. r/learnprogramming/).


Hope these tips will help you maintain your motivation for programming and maybe even help you motivate your peers. Make sure to stay tuned because we have some more secrets to share, especially for intermediate programmers. Also, a big thank you to all the mentors who divulged their secrets to us.

Debbie Chew | Marketing & Operations @ Codementor
I enjoy writing about topics relevant to anyone interested in learning to code or wants to build their own startup. When I'm not blogging, I'm probably watching soap operas or walking my shiba inu.

Discover and read more posts from Codementor Team
get started