What to do when you get stuck…my top tips!

Kevin Michael Johnson
5 min readAug 2, 2021

A career in software development can be stressful just like any other career. You will have your highs and you will have your lows just as you do in any other profession. But it’s how you handle the lows that sets you apart from other developers. One of the most common lows a developer can go through is when they are stuck. Stuck is a scary word for developers, but it’s something we must all deal with from time to time.

What separates a good developer from a great developer is how they get unstuck, and the techniques they use to do so. I’m by no means calling myself an amazing developer, as I’m still getting started, but nonetheless, I wanted to share with you my top techniques and tips to get unstuck. These aren’t in any specific order but they all have a purpose. Let’s jump in!

1) Take Breaks

This one can sometimes seem counterproductive. Why would you take a break when you are stuck and have yet to solve the problem? Why stop when you aren’t there yet? Don’t stop! These are all things that I think we all tell ourselves. We don’t want to take a break because we don’t want to look weak. But taking breaks is not a sign of weakness. It is a sign that you understand your body and understand the importance of recovery.

In a 2013 article, the New York Times wrote: “A new and growing body of multidisciplinary research shows that strategic renewal — including daytime workouts, short afternoon naps, time away from the office for short periods, — boosts productivity, job performance and, of course, health.”

When you get stuck and you’ve been staring at the same computer screen for more than 15 minutes you should simply get up and take a quick walk, grab some water, grab a snack, take a nap, just do something away from your desk. You will be amazed at how often you come back to your desk after a quick 15-minute break and suddenly a new idea will pop into your head, or a new approach to looking at the problem will emerge. Then five minutes later you’ve solved your problem.

You’ve become unstuck. Now of course this will not happen every time this isn’t some type of coding magic, but it’s a reality that taking just a few minutes to refocus your brain can completely change the way you see a problem.

2) Learn Stack Overflow

If you are a developer, and especially if you are a new developer, you should know about Stack Overflow. They describe themselves as, “a public platform, used by nearly everyone who codes to learn, share their knowledge, collaborate, and build their careers. Our products and tools help developers and technologists in life and at work.” When they say “used by nearly everyone”, they mean it. Every developer is likely using Stack Overflow in their daily, if not, weekly work routine.

Essential Stack Overflow is a place to ask questions and get help. Something that every programmer will need from time to time. It’s important to note that there are good ways to ask questions on Stack Overflow, and there are bad ways. Coding requires a lot of information. So it seems logical to assume answering a coding question would require a lot of information. When you ask your question, do your very best to give as much information as you can so the community has the best chance at answering your question thoroughly, but most importantly, correctly. Here are some great examples of good vs bad questions, gotten directly from their site.

Examples:

  • Bad: C# Math Confusion
  • Good: Why does using float instead of int give me different results when all of my inputs are integers?
  • Bad: [php] session doubt
  • Good: How can I redirect users to different pages based on session data in PHP?
  • Bad: android if else problems
  • Good: Why does str == “value” evaluate to false when str is set to “value”?

As a developer Stack Overflow can become your very best friend. The community is large, and the community is smart. If you have a question and you can properly articulate it, there’s a good chance there is someone out there that can answer it. Why wouldn’t you use that type of resource? You would, it’s that simple. So use it!

3) Reading Errors and Having Less of Them

Learning how to debug your code is absolutely essential. When an error pops up it’s never fun to see that red but it’s important to know where to look and how to solve the error. Debugging is going to be different in each language. however, the theories and ideas on how to properly debug remain consistent across all languages, as do the techniques to help stop you from running into errors. One of the most important things to do is always Print. It is important to know what the values of your variables are at any time and the fastest way to do that is using Print.

Next, don’t be afraid to run your code after even the smallest of changes. You really can’t run your code too much. Making sure that your code is running properly after any and all changes make it easier to determine where an error occurred if one does pop up.

Also, this may seem simple but read the error message. The computer is doing everything it can to tell you what happened and where in the code it occurred. every programmer should know that the error message tells you at what line the code broke. Knowing where the issue occurred allows the developer to then work backwards and find the issue.

Finally, don’t be afraid to Simply Google the error.

That may seem weird to just be Googling your solutions to work problems, but that is simply the world that software developers live in. Just as I mentioned previously with Stack Overflow, the online community of developers is large and engaging.

Well, there you have it! My top 3 tips to help you become unstuck. Now of course these aren’t going to work all the time, but I can assure you I’ve used them all to help and they all have many times. When it comes down to it, don’t go down a rabbit hole, ask for help, look for help, and know where to look. And from time to time, don’t be afraid to step away. Breaks are a good thing. Happy Coding Everyone!

--

--