What Should You Do When You Are Stuck on a Programming Problem?

How long should you stick to it?

Abrar Masum
5 min readAug 12, 2021


People pushing a van on a dirt road
Photo by Aubrey Odom on Unsplash

If you are a programmer, you have been stuck in coding problems several times. I still get stuck. Even most of the senior programmers face it frequently.

As a programmer, it’s an important virtue to determine how much time you take to solve a problem and how to find the solution. In the beginning, many programmers take help from others, and that’s normal.

But with time, it’s important to solve the problems by yourself. Almost all senior programmers can solve most problems by themselves.

How to get unstuck?

There are several ways. When the code doesn’t work, my friend often says to restart the computer, the problem might be solved. Haha.

There are no specific ways to get out of the problem, but the industry and senior developers follow some procedures.

Try To Understand the Problem Better

This might sound silly, but this is the reason behind 99% of problems. There are many kinds of problems we get stuck on in daily coding life. Most of them can be classified into three categories:

  1. Code is not working the way you expect.
  2. The problem is understanding the algorithm/data structure/architecture.
  3. You can’t find the solution or the code that is needed.

If you are stuck in the first two types of problems, you need to learn about the architecture or the algorithm.

There is a popular joke about programmers:

“Programmers can debug for ten hours but they can’t read the documentation for ten minutes.”

It’s very true. I also hate to read the documentation. But honestly, it’s very helpful, and it can make your code efficient and clean.

Debugging is also very helpful when you get stuck. If you don’t understand why your code is not working, then a debugger can help you. It helps you to understand the flow and the execution.

Pair With Another Programmer



Abrar Masum

Philosopher || Entrepreneur || Programmer. Contact: mdabrarmasum@gmail.com

Recommended from Medium


See more recommendations