At some point while coding you will get stuck. I don't say that to be negative, it's just a fact. No matter how long you've been coding you will have times when you struggle to find the solution you need. The key is in how you handle those moments.
When you are newer to coding the struggle can be overwhelming. First of all, you get stuck A LOT because your knowledge base is still limited, but also your exposure to different types of issues is limited so you don't have a lot to reference in order to tackle the problem.
As I write this post I am beginning my third week as an intern with Mozilla Localization through Outreachy. There have been many times that I have found myself stuck while working on this project, both during the contribution period and during the internship. I have no doubts that I will be stuck again, and again, as I continue with the project.
For me, getting stuck represents a moment to learn something new.
Don't get me wrong, this was not always the way I felt about these moments. However, over the course of my studies I have seen time and time again that when I make it to the other side of a roadblock, I grow. So, I have come to embrace the struggle and lean into the discomfort of it.
Something that helps me to lean into the struggle comes from a talk given by Marie Forleo that I stumbled across a while back where she shares a simple idea, and that is: 'Everything is Figureoutable'. With this concept in mind I can look at the challenge before me and know that with time, effort, and resources I WILL figure it out.
My first step, I've come to discover, is to slow my thoughts down. When faced with an obstacle or challenge I tend to begin thinking of all the possible scenarios at once and this quickly becomes overwhelming and makes it feel insurmountable.
Once I take a step back and break the problem down into smaller pieces I can begin focusing on tackling each piece one at a time. This is far less daunting! Many times when taking this step I'm able to see that I'm not as far away from a solution as I first thought I was.
Once I know which part of the problem I'm working on I can begin to search for an answer. This is where Google and Stack Overflow become my friends. I will often search different variations of terms to find the most relevant suggestions, and then read through them to find suggested solutions that look like they might apply to my problem.
Another great option that I have used is support networks. Many online programs have chat rooms or discussion channels that you can utilize. Or you can try to find a local meetup or organization that can connect you to other coders who might be able to offer help. One thing I've noticed about the tech community is that while there are those who will criticize, there are far more who want to help.
I'm fortunate in that I have a wonderful local meetup group that has frequent meetings and a robust Slack channel that I can reach out to. In fact, I've been able to solve multiple issues through talking out the problem with other members of this group, and I do my best to make sure that I offer suggestions or help whenever I can as well.
With Outreachy I also have the ability to get help and guidance from my mentors. Considering that this is my first time really working on a code base that isn't solely mine and is also quite large, this is a huge benefit. Having someone who can see where I started from, guide me as I step out of my comfort zone, and offer suggestions of where to look for solutions when I'm stuck has been extremely helpful.
If you have the opportunity to work with a quality mentor, whether through a program like Outreachy or not, I highly recommend you take that opportunity. It has really helped to push my skills further in a way that prior experiences had not.
In the end, it is important to remember that being stuck does not mean you are not capable it simply means you lack the information needed to solve the problem. So, take a breath, research, and reach out for help and before you know it you will have figured it out!