Essential Strategies For Getting Unstuck As A Newbie Developer

3 months ago 7

Writing computer programmes is a very challenging endeavour because the exercise is usually plagued with many red errors along the way. A lot of times, you are going to encounter problems that you do not know how to solve. But you don’t have to beat yourself up for it: facing a blocking issue that’s difficult for you to diagnose is something that happens to every developer (including seasoned developers with years of experience under their belts). However, I acknowledge that getting stuck can be very frustrating — whether it’s not being able to find the bug in your code or having troubles coding out a solution to a particular task, being stuck is one of the most unpleasant parts of software development. That being said, it is also one of the most critical aspects of programming. A developer who can get unstuck when they hit roadblocks is worth their weight in gold and in most cases, they tend to be an invaluable asset to any team.

Below, I have curated a list of approaches and techniques. They are based on my experience developing software and I believe they would prove valuable to any noob or junior developer trying to get unstuck from a programming stumbling block.

Be comfortable with error messages

One of the things I tell every newbie under my guardianship is that error messages are your friends, so it is important to get comfortable reading them when they pop up in your code or during code compilation. A lot of beginners tend to panic at the sight of an error message as if it was the proclamation of impending doom. On my part, I explain calmly on how the error is trying to help them by sending them the message. The error message is not a threat, it’s a tool to help you find issues lurking somewhere in your code. When an error appears on your screen, you should find and focus on the line being referenced by this error in your code. Usually, most error messages tend to be accompanied by boilerplates that are not very relevant to the error at hand. You want to calmly go through the error message and find that part in the error that gives you insight as to what happened. You can also copy and paste the error to the Google search engine and go through the search results. In most cases, this problem is not unique. There are people who might have experienced similar errors in their code and you get to use their solutions to resolve your own problem. You can also leverage the different AI tools like ChatGPT, Copilot or Gemini or ask for solutions on the developers’ community platform like Stack Overflow.

Break down the problem

Sometimes we get stuck because we are overwhelmed by the enormity of the task ahead of us. In most cases, problems feel enormous because they are not well defined and analysed. By simply decoupling an enormous problem or task into smaller steps is enough to help you get unstuck. Big problems are like giant puzzles, you first break them into smaller solvable pieces. In essence, focusing on the tiny step first is highly imperative.

Let’s say you want to write a function that reverses a string, you will typically need to first determine what the input and the output are going to be. Is the function input going to be just a string of characters or an array of strings or even numbers? And what do the reversed characters supposed to look like? You also typically have to determine if your programming language of choice offers a method for easily performing the task. My favourite programming language is JavaScript, so I have access to the reverse method built into the language. And finally, I will go ahead and plan the most efficient approach to complete the task. If the input is a string, then I have to first convert the string into an array of characters using the Javascript split method, reverse the array by calling the JavaScript reverse method on it and finally join the array of characters in order to convert it back to string using the join method. Essentially, When a number of clear, small steps are laid out before you, it becomes easy to knock out one after the other. This builds momentum, which will help carry you through difficult sticking points.

Write pseudocode

Writing down in plain English (or your native language) what you want to achieve is crucial to helping you develop a clear approach to the problem at hand. It also prevents you from getting bogged down in the details of the syntax of that programming language. By doing this, we can focus our attention on the thought process behind the algorithm and how it will (or won’t) work instead of focusing on the syntax. Since pseudocode is written in a human-readable format, it is easier to edit and discover bugs before actually writing a single line of code. We can edit pseudocode more efficiently than testing, debugging and fixing actual code. I have adopted this strategy a couple of times and it has proven very handy and efficient in situations where I struggled to initially understand how to implement solutions around certain tasks and problems. Pseudocode is an underestimated and under-utilised tool within the programming community, but a clear, concise, straightforward pseudocode can make a big difference on the road from idea to implementation — and a much smoother ride for the programmer.

Reach out for help

By now, you’ve probably attained the limit of what you can do alone. You’ve most likely spent a few hours trying to solve the same problem with no headway or solution in sight, then it’s time to bring in reinforcements. Find a co-worker who has a lot more experience than you do and ask them for help. If you have no coworker to ask for help, then reach out to your mentor. I have personally set up pair programming sessions with my mentor a couple of times to diagnose problems together and the outcomes have always been positive. It helped me get unstuck faster and move on to the next task. If you don’t have a mentor, now’s a good time to put that on your to-do list. The importance of being under the guardianship of a mentor cannot be overemphasised. You don’t have to worry about the possibility of wasting their time. You’ve researched and thought through the problem, so you can describe it completely and succinctly. And for you to keep trying on your own could turn into a much more serious waste of time.

Walking away

By just closing the lid of your computer and stepping away from it, you’re letting your subconscious mind take over the problem-solving task. Your brain doesn’t stop thinking just because your fingers stop typing. Give it some rest and do things that aren’t mentally demanding. Strike up a conversation with someone you enjoy talking to, go for a walk, do some exercise, listen to music, play video games, take a nap and a host of other fun activities. You need to give your brain a rest. You’ve become emotionally invested in the problem, and your emotions (especially frustration) are clouding your thought process. You want to let go of your feelings about the problem. You need to let go of what you’ve already tried to do. Those attempts didn’t work. You can’t keep attacking the problem from the same point if you want to move past it. Has an idea ever popped into your head while you were doing something other than programming? Have you ever returned to a problem after a fun activity and the solution is staring at you in the face? It has happened to me a couple of times. Sometimes all we need for a breakthrough is fresh air and separation from the problem. Even if we don’t find a solution during a break, a relaxed and detached perspective is necessary for clearing up our thought process and making progress on the problem.

Finally, if you’re able to solve a problem, it is pertinent to write some documentation around it to alleviate the frustration of other developers who may be struggling to get unstuck from similar problems. This might be a comment in the code, a page on your company’s internal docs, a newsletter, a post on your blog or dev.to, or a self-answered Stack Overflow question.

In conclusion, the reality of being a software developer is that you are going to get stuck. It’s frustrating, but it happens to everybody. Therefore, it is important to approach it with a positive attitude. You may try just one of the above approaches and have a “light bulb” moment, or you may need to try a combination and find yourself simply inching along during the process. However, remember to take constant breaks and experiment with the different solutions and maintain a positive attitude. These are important strategies that are capable of transforming obstacles into valuable learning experiences and invariably help you grow and succeed in your programming journey.

Happy coding.

Hamed Jimoh

Software Developer, Brand Central

Visit Source