12 Unbelievable Things You Never Knew About What to Do When You’re Stuck on a Coding Problem
Tags: beginners, productivity, webdev, devops
Published: 2022-11-25 13:49:31

---
title: 12 Unbelievable Things You Never Knew About What to Do When You’re Stuck on a Coding Problem
published: true
tags: beginners,productivity,webdev,devops
canonical_url: https://makendran.hashnode.dev/12-unbelievable-things-you-never-knew-about-what-to-do-when-youre-stuck-on-a-coding-problem
---

## Admit that you are stuck

_![markus-spiske-KTuHfak_EEk-unsplash.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1661463226724/_PiH4S3PK.jpg)Photo by [Markus Spiske](https://unsplash.com/@markusspiske?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/blocked?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)_

Recognizing that you are stuck may not be so obvious at first. But realizing that you are in a place where there are more unknowns than clarity is more powerful than you think. Not recognizing this can waste your time trying to make things work that aren't as necessary.

Not because you don't know how to do something and can't figure out how to get it working in 5-10 minutes, which means you're stuck. Getting the definition of "getting stuck" wrong and not trying any more could hurt your ability to solve problems in the long run.

## Do not panic

![jasmin-sessler-egqR_zUd4NI-unsplash.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1661463333643/MbzWid0ik.jpg)_Photo by [Jasmin Sessler](https://unsplash.com/@jasmin_sessler?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/panic?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)_

First things first: don't panic. You understood. Mistakes aren't something to be feared or discouraged - they are actually learning opportunities! So take a deep breath to calm yourself down before trying to free yourself using any of these strategies.

Calmness is the first step to becoming a positive person. Have confidence in yourself and your problem-solving skills. You can find out, and it will be much more enjoyable if you do it in a learning and growing mindset.

## Read error

![brett-jordan-XWar9MbNGUY-unsplash.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1661463910392/mcolnD_2t.jpg)

_Photo by [Brett Jordan](https://unsplash.com/@brett_jordan?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/error?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)_

Take the time to read the error you received. Not reading the error carefully or not understanding the error is a common mistake beginners make. By understanding the errors you receive and connecting the dots between each error message and the solution to the problem, you gain valuable programming skills.

## Check your spelling

![correcting-g7ce6e6f5b_1920.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1661464095525/neDtDC4ly.jpg)

_Image by [Lorenzo Cafaro](https://pixabay.com/users/3844328-3844328/?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=1870721) from [Pixabay](https://pixabay.com//?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=1870721)_

Some of the most common errors we see have to do with spelling and syntax. It means that we misspelled or mislabeled something somewhere in our code. An example would be if you forgot to put quotes around your string. The code can't read your mind and doesn't equate String to "String" as expected.

Other common syntax errors are:

- Incorrect use of parentheses and braces
- Using the wrong number of equal signs
- Using different cases

You can avoid many of these mistakes by sticking to your conventions. An example of this is to always capitalize the first letter of your variables - that way there are no case errors.

Try to program using the style standards of the language you are using. Style guides help reduce the error rate by making your code more readable, making it easier to find errors.

## Verbalize the problem

![alena-jarrett-aOm1qcNc6Lw-unsplash.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1661464319304/_L1ax31zs.jpg)

_Photo by [Alena Jarrett](https://unsplash.com/@jarretto18?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/loud?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)_

Another helpful strategy to break free is to speak out loud about your problem. Your problem could be a section of code you're working on, a problem you're solving for a client, or even a personal project. Make sure you know what the result should be.

By speaking out loud, you begin to solidify in your head what you are trying to achieve. Then you can go back to your code and find out if it actually does what you want it to do. If there's a piece of your code that doesn't help you achieve your goal, that's probably where the mistake lies.

## Break the problem

![pankaj-patel-u2Ru4QBXA5Q-unsplash.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1661465005048/lWWcb-2C-.jpg)

_Photo by [Pankaj Patel](https://unsplash.com/@pankajpatel?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/code-into-smaller-chunks?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)_

If you think of your code as one big block, it can seem like a huge undertaking to track down a flaw. But if you break your code into smaller chunks, each of which performs a small task, it will be much easier to understand where the error is.

As discussed above, if you take the time to read and understand the error message, you will know what kind of error you are looking for. You can also use the verbalizing hint to talk about what each block of code does and whether that particular flaw might be in each block of code.

If you are still stuck, you may need to run the code backwards. This means reversing each step of the code until you find the error. This tip is especially useful if the code in the previous sections worked correctly. Chances are the error is at the bottom, so you will find it faster by working in reverse.

## Search on Google

![charlesdeluvio-leqrylJNYUQ-unsplash.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1661465187978/u4Fr5Akem.jpg)

_Photo by [charlesdeluvio](https://unsplash.com/@charlesdeluvio?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/search-google?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)_

Even though we said there's no magic button to help unblock you, sometimes Google is a pretty close alternative.

Be as specific as possible when using Google to break free. You can copy and paste your error message directly into Google and then see the search results that apply most to your piece of code. If the returned results aren't helpful, think about how to rephrase your search to get you closer to the solution.

## Ask someone else the question

![emily-morter-8xAA0f9yQnE-unsplash.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1661465477273/pKzJsFIgJ.jpg)

_Photo by [Emily Morter](https://unsplash.com/@emilymorter?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/question?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)_

There is nothing wrong with asking for help or taking another look at our code. While junior programmers often ask more experienced programmers questions, there's nothing wrong with having 15 years of experience and you're asking someone who has a few years of experience behind them.

It's complicated to know everything in the world of programming. There will always be something that someone knows that you don't know. Sometimes it's surprising to see where some of the best answers come from and some might come from people you never thought they could.

## Ask your questions in the forums

![chris-montgomery-smgTvepind4-unsplash.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1661465567579/9DAUXwh3o.jpg)

_Photo by [Chris Montgomery](https://unsplash.com/@cwmonty?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/documentation?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)_

Many programmers look for other solutions to common problems, read the StackOverflow and GitHub forums, but never ask a question. There can be various reasons why many do not.

Some people are afraid to ask questions in public and risk being called unintelligent. However, it is sometimes surprising how many people ask the same question as you.

Others don't do it out of laziness. We get lazy by doing certain simple things without realizing it. For example, some programmers don't ask questions in forums because they don't have an account on that forum, even if they visit the forum over and over again. Creating an account is fast. However, the desire to look for similar questions leads you to not even try to post the question. In other cases, programmers need the answer right away and can't wait for someone to answer the question on the forum. Asking the question on a forum and working on it at some point while getting answers can be the most efficient use of your time in some cases.

## Check the documentation

![sigmund-cdMAU_x9mxY-unsplash.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1661465684909/amG3pTxAz.jpg)

_Photo by [Sigmund](https://unsplash.com/@sigmund?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/documentation?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)_

Not everyone does this at first. However, documentation aims to provide a single source of truth about how a programming language, library, framework, or architecture works. Spending some time reading the documentation will give you a better understanding of how things work and give you ideas on how to tackle the same problem using different approaches.

## Take breaks or walk away

![alejandro-luengo-jSvoR46Xk8Q-unsplash.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1661465790373/HeGffW0QA.jpg)

_Photo by [Alejandro Luengo](https://unsplash.com/@aluengo91?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/walk?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)_

When you've tried different things and researched a lot of information, but still can't get things to work, you become tense and stressed. Taking a break is the best choice right now. Taking a walk or getting away from your computer are simple but effective ways to clear your head and relax.

You can choose to escape, but still think about the problem you can't solve. The main difference here is that you're not looking at a screen reading your code or online information that after a while makes it difficult for you to think clearly. Being able to place information in an environment with little or no distractions helps a lot in finding solutions. Just be sure to take a pen and paper with you to write it down when you meet him.

## Let it go

![samuel-regan-asante-uE4gXrpDzxw-unsplash.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1661465930460/0BX04J55Q.jpg)

Photo by [Samuel Regan-Asante](https://unsplash.com/@fkaregan?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/let-it?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)

There have been instances where the software has a certain bug which is never fixed as it does not affect the user experience or affect the business logic. Other times it's a bug that no one on the team has been able to fix before due to its complexity.

Whatever the reasoning, it's okay to not go ahead and try to make something work. You may not feel comfortable with this at first since you as a programmer want things to work. However, sometimes the best decision is not to insist on making things work that shouldn't work.

Gratitude for perusing my article till end. I hope you realized something unique today. If you enjoyed this article then please share to your buddies and if you have suggestions or thoughts to share with me then please write in the comment box.

Follow me and share your thoughts,[GitHub](https://github.com/MakendranG)[LinkedIn](https://www.linkedin.com/in/makendran/)[Twitter](https://twitter.com/MakendranG)