This tutorial is old, my app is broken, and I’m really tired: Some advice

May 24, 2022

I saw this comment on Reddit a couple days ago, and it hit me like a ton of bricks:

I found the version of react-router-dom used in the course, but when I made a roll back the project was still not working so I felt really tired and just started another course :(

🧱🧱🧱

Oh friend, I have been there. I remember those days clearly.

You start some new course or tutorial, and there is this feeling of excitement. It’s palpable! Everything is fresh and you’re gonna build and learn and life is good.

Things usually start well enough. A few lessons in and you’re tracking and things are working. But inevitably, there comes the crash. The difficulty ramps WAY up, your code breaks, and you can’t for the life of you figure out why. You guess and check a hundred different things. There are chunks of code commented out everywhere. You try to rollback to when things were working… still no dice.

We’ve all been there. Many times.

So here is my list of what to remember and what to do when you get stuck like this in your web development journey.

  1. Recognize the pain is valuable
  2. Be as systematic as possible
  3. Take a break
  4. Ask for help
  5. Know when to persevere and when to move on

1. Recognize the pain is valuable

This is, by far, the most crucial thing I want to convey. This experience you are having- of wresting with code, feeling frustrated, trying to figure out what went wrong and how to fix it… this experience is solid gold to you. It’s incredibly valuable. It’s just as valuable (if not more so) than the actual course material.

If you’ve been exposed at all to the world of programmer humor and coding memes (yes, that is a world) you quickly pick up on the fact that life as a developer is split between

  1. the soul-crushing frustration of wresting with nonworking code and
  2. with the overwhelming elation of when you finally figure it out.

It’s just part of the game! Yes, you do eventually get better, and working through problems and issues gets easier and more intuitive. But at the core developers get paid to solve problems.

So the goal is not to avoid situations like this, but instead to learn and grow and get more skilled at handling situations like this.

So while this doesn’t necessarily help solve the technical issue you’re stuck on right now… remember: this is part of being a developer. Take a deep break. No pain, no gain.

2. Be as systematic as possible

Here we start to get into a little bit more tactical help for the issue. The goal here is to move from a semi-random guess-and-check approach to a clear-headed systematic strategy of troubleshooting.

At first, you may be tempted to debug in a “throwing spaghetti at the wall” type of approach. This looks like a ton of random Google searches, dozens of console.logs and commented out chunks of code. And sometimes this works. But if it doesn’t, you’re not left in a very great spot.

Instead, take a moment to think and plan. Write down a list of the top few things you think may be the issue. Then start working through your list, one at a time. For each item, figure out how to eliminate it as the cause of the issue with as near 100% certainty as possible. Then move on to the next item. As you think of more potential culprits, add them to your list.

This approach helps calm your brain and restore a sense of control to the process. Rather than feeling more lost and frustrated with each failed guess-and-check, now you’re making consistent progress and getting closer with every step.

3. Take a break

Simple, but effective. If you’ve been struggling with the issue for awhile, take a break. Go for a walk, grab lunch, exercise and shower, follow a 20 minute yoga video on YouTube.

I’m a huge believer in the unconscious brain’s ability to continue processing the issue as we step away. Most developers have a story or two of a code solution coming to them in the shower or in a dream.

4. Ask for help

Even with a clear-headed and systematic approach, and with well-timed breaks, there will be times when you can’t figure the issue out. It’s time to reach out for help if you haven’t done so yet.

Depending on the issue and your personal network, this might be a dev friend you can screenshare with, or an online forum or site where you can post your question and code snippet. Be logical about where to ask, and be considerate of the person you’re asking (be well prepared, share what you’ve done so far, and be respectful and appreciative of their time).

Don’t be too shy! Be willing to put yourself out there.

5. Know when to persevere and when to move on

By this point, hopefully you’ve got the issue solved and have moved on. But maybe not. Maybe this issue is crushing you, despite everything you’ve thrown at it.

While you need to have a tendency toward perseverance (remember item #1 above), there are times to move on.

I remember listening to a podcast with a programmer who talked about how his #1 suggestion to new developers is to work on whatever keeps you coming back to write code the next day. The main point is not whatever exact thing you’re working on at this moment. What matters more is that you keep coming back.

So embrace the struggle, but also embrace the freedom you have to start over with something new. There is no wrong answer here, as long as you keep showing up.

Want more like this? Sign up to get one article delivered weekly by email.
© 2023 Mark Foster