How To Get Unstuck When Learning To Code

Step back, use other resources and add some fun.

Felix Cabrera
Nov 4 · 4 min read
Photo by JESHOOTS.COM on Unsplash

Before you give up learning to code, read this …

I remember when I started to learn how to code, I was very motivated and started to make a lot of progress. However, after I got to some challenging concepts (for me), then I began to lose momentum.

Moreover, I remember when I was learning the basics of computer programming, way back in the day, I started to encounter bugs in my code (which I still do). I was learning recursion at the time, and it was a concept that I didn’t understand so easily.

Can you relate?

Thus, I started to feel stuck when learning recursion because I didn’t fully understand what was going on in my code.

However, through this process, I started to find ways to get unstuck and keep learning more concepts when learning to code.

Today I want to share some things I did that helped me get unstuck when learning to code so that you can do them too.

Step Back

The first thing I did when I encountered bugs in my code, and I couldn’t solve it for some time, I stepped back and took a break. This helped me refocus and recharge after staring at the screen for an extended period.

When I came back to revisit the code, I often saw the error in my code that I didn’t see before. Thus, taking that break helped me increase my productivity.

Which for me was counterintuitive at the time, I thought that spending less time working on your code was not going to help you get over any obstacles.

Nonetheless, it did help me a lot.

Here are some suggestions of activities I did to step back and recharge when stuck learning to code:

  1. Take a quick walk
  2. Watch a funny video
  3. Drink a glass of water
  4. Took a nap (if I had time)

The purpose of these activities is to make you change your focus from the frustrating thing that you can’t see in your code.

Then, after distracting yourself, you come back to take a look at your code with a fresh perspective.

Use Other Resources

If you can’t understand a specific concept with the resources that you are using, then try changing it up a bit. It might be that the way the person who is explaining the idea does not resonate with you.

Or the learning tools you are using do not fit your learning style.

Here are some examples:

  1. Find a new book you can use as a reference
  2. Watch a video explaining the topic
  3. Find a tutor
  4. Ask a classmate (or friend)
  5. Use an online course as a supplementary material

These are ways you can use to try to get a new perspective on the topic you are struggling with when learning to code.

Add Some Fun To Your Learning Experience

This may help more people who are teaching themselves how to code. But something I noticed after some time learning to code, I started to get unmotivated to keep learning.

The strategy I was using was turning monotonous. Now that I look back at it, this probably one of the main reasons I felt stuck.

Hence, I stopped being consistent writing code and doing practice exercises. A way I found to overcome this is to mix some of my other interests with programming.

For instance, I like sports, so I started to work on projects that would help me apply the concepts I was learning, but also mix it with sport-related topics such as basketball. Which made it a lot of fun, and I started to get remotivated again.

However, it doesn’t have to be sports. You can find ways to mix your interests with coding. Perhaps you like music. Then you can make a program that lists the songs of your favorite artists.

Or you like movies, which you can also find a way to work on a project that can display your favorite movies and sort them by actor, to give you an idea.

The purpose of this strategy is to spice it up. I know this helped me when I was feeling stuck to keep learning how to code.

Final Thoughts

When feeling stuck learning to code, the key is to step back, recharge, and look at your code with a different perspective.

Staring at the screen for countless hours with no results is not going to help. I know it may seem counterintuitive, but for me, staring at the screen for hours did not help increase my productivity at all.

On the other hand, when I took a break, I could think of ways I could solve the problem in my code.

There you have it, things I have learned through the years so you can use these insights in your coding journey.

I hope this helps!

Disclaimer: Results may vary. These tips and advice are based on my experience and opinion as a former undergraduate Computer Science student, tutor, teacher, and software developer. Everyone is different, so the advice shared in this article may or may not work for you.

Originally published at

Felix Cabrera

Written by

A.k.a. Felix The Dev. Software Developer. Programming teacher, tutor, and coach.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade