The Ever Growing Dev ๐ŸŒฑ

The Ever Growing Dev ๐ŸŒฑ

Share this post

The Ever Growing Dev ๐ŸŒฑ
The Ever Growing Dev ๐ŸŒฑ
๐ŸงŠ Stuck On Code? Hereโ€™s How To Unblock Yourself
User's avatar
Discover more from The Ever Growing Dev ๐ŸŒฑ
Building a community of ever-growing developers, seeking to improve programming skills, and stay on a journey of continuous self-improvement. Focusing on tips for powering up your programming productivity ๐Ÿš€. Letโ€™s grow together ๐ŸŒฑ
Already have an account? Sign in

๐ŸงŠ Stuck On Code? Hereโ€™s How To Unblock Yourself

Practical tips for what to do when you get stuck when coding.

Cherlock Code ๐Ÿ”Ž's avatar
Cherlock Code ๐Ÿ”Ž
Jun 22, 2023
1

Share this post

The Ever Growing Dev ๐ŸŒฑ
The Ever Growing Dev ๐ŸŒฑ
๐ŸงŠ Stuck On Code? Hereโ€™s How To Unblock Yourself
Share

Hello to my fellow ever-growing devs,

I took some annual leave off work this week and I wish I could say that I jetted off somewhere for an amazing holiday โœˆ๏ธ, but sadly not this time round.

I say โ€œsadlyโ€, but really and truly thereโ€™s nothing sad about it.

Sometimes you just need to take a break, to step outside of your everyday routines and take some time to reevaluate yourself and plan ahead.

So thatโ€™s what Iโ€™ve mostly been doing. Iโ€™ve also been able to make some good progress on my project, so fingers crossed Iโ€™ll have some good news for you all next week ๐Ÿคž

Anyways letโ€™s jump into it and see a good reason why sometimes youโ€™ve just got to take a break!


Thanks for reading The Ever Growing Dev ๐ŸŒฑ! Subscribe for free to receive new posts and support my work.


If thereโ€™s one thing thatโ€™s guaranteed in any programmerโ€™s journey itโ€™s the fact that you WILL get stuck.

Thereโ€™s no way to avoid it.

There isnโ€™t a single developer that hasnโ€™t been stuck on a coding problem at some point.

Solving problems is the aim of the game, itโ€™s part of the job description and itโ€™s what we do best.

If youโ€™re learning to code, then getting stuck and overcoming those problems plays a massive part in becoming a successful developer.

A problem solved today is a problem halved tomorrow.

Getting stuck doesnโ€™t mean youโ€™re stupid, or youโ€™re not cut out for programming. Thereโ€™s always a solution, but the challenge lies in how and where to find it.

With so many bugs and errors you could possibly encounter, it would be impossible for me to describe how to fix each issue separately.

But what I can do is give you some tips on how to unblock yourself no matter the issue.

A boy breaking through a wall of ice
AI generated image created using Midjourney

In this article, weโ€™ll look at some techniques for unblocking yourself and knowing what to do when you get stuck.

So before you start to panic or get frustrated, try these things first:

1) Embrace the problem ๐Ÿค—

If youโ€™re faced with a coding challenge, itโ€™s easy for those feelings of being overwhelmed or annoyed to creep in.

However, the first step to unblocking yourself as a programmer is to embrace the problem and see it as a valuable learning experience.

It requires a mindset shift, where you view each challenge not as a roadblock, but as a stepping stone toward growth and mastery.

Adopting a growth mindset is key.

Instead of seeing challenges as these great big hurdles, see them as opportunities for personal and professional development.

Understand that every bug, every error message, and every roadblock holds a lesson waiting to be learned.

By approaching coding challenges with a growth mindset, you open yourself up to new possibilities and empower yourself to tackle even the most complex problems.

Once you get your mind right, and settle your thoughts youโ€™ll then find yourself more open to seeking the solution.

2) Break it down ๐Ÿ”จ

So now you know youโ€™ve got a problem, youโ€™ve embraced that it is what is, and now youโ€™re ready to find a way to solve it.

No matter how big or small the issue may be, it is always best to try and see how you can break it down into smaller, more manageable chunks.

This approach not only simplifies the problem at hand but also makes it easier to troubleshoot your issue moving forward.

To effectively break down problems, start by analysing the issue. For example, if itโ€™s a bug in your code, identify the key components or functions involved.

Then, think about the logical steps needed to achieve the desired outcome. Think about the input and output. Say to yourself if I input X then I want my code to output Y. And if the output is not what youโ€™re expecting, you can then try to determine what is stopping it from working.

As good practice try to organise your code in a structured manner, by dividing your code into smaller functions or modules.

That way you can encapsulate specific functionalities and make them more manageable.

This modular approach allows for easier debugging, maintenance, and code reuse over time.

3) Try to debug it ๐Ÿ•ต๏ธ

In programming, the most common problem youโ€™re likely to get stuck on is a bug.

And just like in nature bugs can be invasive and annoying.

There are several debugging techniques you could use to try and help you find a solution to your issue.

Letโ€™s look at a few key ones:

  1. Print Statements

    This involves strategically placing print statements (or console logs) within the code. By inserting print statements at critical points, you can output variable values, execution flow, and other pertinent information.

    This allows for real-time insights into the program's behaviour and helps to identify problematic areas.

    For example, when encountering unexpected outputs from a function, inserting print statements at different stages can provide visibility into variable values and help pinpoint the source of the issue.

  2. Debugging Tools

    Integrated Development Environments (IDEs), code editors and other development tools offer advanced debugging features that enhance the efficiency and accuracy of the debugging process.

    These tools provide capabilities such as breakpoints, step-by-step execution, and variable inspection, enabling you to closely examine code execution and diagnose issues at a granular level.

    For example, when faced with a runtime error that is difficult to reproduce, setting a breakpoint at the suspected line of code will allow you to pause execution, inspect variable values, and analyse the program's state.

    By stepping through the code, you can identify the precise location where the error occurs.

  3. Error Handling

    When code lacks error handling, it is prone to crashing when encountering bugs. However, with error handling in place, errors are intercepted before they can disrupt the application.

    The error is then processed, such as through logging or storing it in a database, allowing the application to continue running smoothly.

    This is especially effective in identifying bugs in a production environment. By collecting errors as they occur, you can analyse them later to determine the underlying bug causing the errors.

  4. Commenting out code

    One straightforward yet useful debugging method is to "comment out" sections of code.

    By converting functional code into comments, those lines are rendered inactive and not executed. The process starts by commenting out code in the specific part of the application where the problem is suspected. Gradually, each line of code is reintroduced one at a time, then you can monitor for the reappearance of the bug.

    This technique allows you to isolate the problematic code section, go through it line by line and hopefully identify where the bug is occurring.

Debugging will take a while to practise and master, but over time youโ€™ll be able to quickly use and combine all of these techniques, which will help you to solve your issues much faster.

4) Try Rubber Duck Debugging ๐Ÿฅ

Tell your problems to a Rubber Duck ๐Ÿฆ†.

No this isnโ€™t a joke, and I kid you not.

Rubber duck debugging is an unconventional yet remarkably effective problem-solving technique.

The principle behind rubber duck debugging stems from the idea that verbalising a problem forces you to articulate and examine it from different angles.

The concept of explaining code problems to an inanimate object, such as a rubber duck, can work wonders in decoding complex issues.

By explaining the code step by step to an attentive rubber duck listener, you're essentially talking through the problem aloud.

This process helps to organise your thoughts, highlight assumptions, and identify gaps in your understanding. You then may find yourself naturally scrutinising the logic behind each line of code.

Rubber duck debugging provides a fresh perspective and serves as a non-judgmental sounding board for developers.

Thereโ€™s no shame in talking to yourself (or a rubber duck).

5) Read the Docs ๐Ÿ“–

This one may sound obvious, but youโ€™ll be surprised just how easy it is to forget that most programming languages, frameworks and libraries have official documentation available to help support you.

These docs may seem lengthy and in-depth, but thatโ€™s the whole point.

They are written to give you insight into how things work, how to use certain methods, components or blocks of code etc. And they may even contain troubleshooting information.

Now we even have many community-contributed documentation, where people have added more information to support the official docs.

Chances are a lot of the time, that the issue youโ€™re facing has been captured and written about somewhere.

Also, by reading the documentation you may also discover techniques for making your code more robust, and less bug-prone.

Sometimes the easiest problems are solved simply because we werenโ€™t implementing or using something correctly. Docs are a useful way to help with that.

A good tip is if youโ€™re using something in your code that youโ€™re unfamiliar with, read the documentation about it thoroughly first.

That way you can help avoid making simple mistakes that turn into big frustrating problems later.

6) Seek Online Help ๐Ÿ”

Many of the techniques I mentioned above may already involve doing this, but I thought it was still important to highlight the biggest problem-solving tool youโ€™ll have access to - the Internet.

Thereโ€™s a reason most developers will often joke and say that 80% of their time is spent Googling.

And thatโ€™s simply because Google and the rest of the online world is the most comprehensive place to find solutions to programming problems.

If you have an error message, all you have to do is Google it, and youโ€™re very likely to find information written by others.

Online communities, such as programming forums (like StackOverflow), developer communities (like Dev.to & Hashnode), and open-source project spaces (like GitHub), provide excellent platforms for seeking help and engaging with other developers.

These communities are full of passionate programmers who are eager to share their knowledge, offer guidance, and collaborate on projects.

By actively participating in these communities, you not only gain access to a wealth of expertise but also build a network of supportive peers who can provide encouragement and motivation during challenging times.

7) Take a step back ๐Ÿšถโ€โ™‚๏ธ

If youโ€™ve tried all of the above and youโ€™re still stuck or frustrated, itโ€™s time to take a step back.

Sometimes weโ€™re so focused on getting something to work that we lose track of time and ourselves.

In our quest to solve our problem or debug our code, we get into tunnel-vision mode and this can actually hinder our thought process and capabilities.

If youโ€™ve already spent a significant amount of time on a problem, the best course of action is to temporarily step away from the code and allow yourself to gain some fresh perspective.

Stepping away from the screen and shifting your focus to other activities can have remarkable effects on problem-solving.

One of the main benefits of taking breaks is the opportunity for your mind to relax and reset.

Doing activities unrelated to coding helps you detach from the problem at hand and gives your brain a chance to process information subconsciously.

This mental rest often leads to breakthroughs and "aha" moments when you least expect them.

I canโ€™t tell you how many times Iโ€™ve found a solution to a bug whilst I was casually going about my day and distracting myself from solely focusing on my problem.

Stepping away doesnโ€™t mean giving up, it means youโ€™re giving your brain and eyes a well-deserved rest, so you can come back more energised and empowered than ever!

Conclusion

To conclude, as weโ€™ve recognised getting stuck is not a matter of "if," but rather "when."

Adopting a growth mindset and viewing setbacks as valuable lessons enables you to transform frustration into motivation.

Breaking down complex problems into manageable chunks enhances troubleshooting and problem-solving capabilities.

Practical debugging techniques, such as print statements, logging, debugging tools, error handling, and commenting out code, helps you to efficiently identify and resolve issues, ensuring smooth code operation.

Exploring the concept of rubber duck debugging, where explaining code problems to an inanimate object like a rubber duck brings clarity and reveals solutions, opens up new perspectives.

Reading documentation, and online resources provides access to a wealth of expertise and alternative approaches from the main source and others.

So the next time you get stuck, remember it wonโ€™t be the last time, but hopefully, these steps can help you get through it and you can unblock your way to victory!

From your fellow ever-growing dev,

Cherlock Code


Cached by Cherlock โœจ:

๐Ÿณ 6 Top Websites to Learn About Docker and Containerisation

โšก๏ธStart Coding Fast With These 8 Online Code Editors


Programming & Productivity Picks of the Week ๐Ÿš€:

๐Ÿง  Brain Bites

JavaScript localStorage: The complete guide

๐Ÿ›  Tools of the trade

Gitignore.io - Create useful .gitignore files for your project.

๐Ÿ’ก How-To's and Woo-Hoo's

How to Use Redux and Redux Toolkit


Enjoying my content and want to show your support?

How about sponsoring my Green Tea addiction? ๐Ÿซ– (Itโ€™s not as bad as it sounds I promise ๐Ÿ˜…)

Your support will help me massively in continuing to give you great quality content. Thank you!


Subscribe to The Ever Growing Dev ๐ŸŒฑ

By Cherlock Code ๐Ÿ”Ž ยท Launched 3 years ago
Building a community of ever-growing developers, seeking to improve programming skills, and stay on a journey of continuous self-improvement. Focusing on tips for powering up your programming productivity ๐Ÿš€. Letโ€™s grow together ๐ŸŒฑ
1

Share this post

The Ever Growing Dev ๐ŸŒฑ
The Ever Growing Dev ๐ŸŒฑ
๐ŸงŠ Stuck On Code? Hereโ€™s How To Unblock Yourself
Share

Discussion about this post

User's avatar
๐Ÿฆพ How To Use ChatGPT for Learning to Code (With Examples)
A beginnerโ€™s guide to using ChatGPT to help with learning how to code.
Sep 21, 2023 โ€ข 
Cherlock Code ๐Ÿ”Ž
1

Share this post

The Ever Growing Dev ๐ŸŒฑ
The Ever Growing Dev ๐ŸŒฑ
๐Ÿฆพ How To Use ChatGPT for Learning to Code (With Examples)
๐Ÿฆ 6 Best Online Resources to Learn NestJS for Free
Exploring the top free courses and tutorials for learning NestJS.
Jun 13, 2024 โ€ข 
Cherlock Code ๐Ÿ”Ž
2

Share this post

The Ever Growing Dev ๐ŸŒฑ
The Ever Growing Dev ๐ŸŒฑ
๐Ÿฆ 6 Best Online Resources to Learn NestJS for Free
๐Ÿฑ 15 Japanese Techniques for Developers to Boost Your Productivity!
Tips and methods for increasing your productivity the Japanese way.
May 9, 2024 โ€ข 
Cherlock Code ๐Ÿ”Ž

Share this post

The Ever Growing Dev ๐ŸŒฑ
The Ever Growing Dev ๐ŸŒฑ
๐Ÿฑ 15 Japanese Techniques for Developers to Boost Your Productivity!

Ready for more?

ยฉ 2025 Cherlock Code ๐Ÿ”Ž
Privacy โˆ™ Terms โˆ™ Collection notice
Start writingGet the app
Substack is the home for great culture

Share

Create your profile

User's avatar

Only paid subscribers can comment on this post

Already a paid subscriber? Sign in

Check your email

For your security, we need to re-authenticate you.

Click the link we sent to , or click here to sign in.