Vanta Logo
SPONSOR
Automate SOC 2 & ISO 27001 compliance with Vanta. Get $1,000 off.
Published
3 min read
Up to date

Trevor I. Lasn

Staff Software Engineer, Engineering Manager

Mental Toughness is the Best Quality a Developer Can Have

Mental toughness gets developers through challenges like debugging, picking up new tools, and hitting tight deadlines. It’s about staying calm and pushing through when things get tough.

Programming isn’t just about writing code. It’s about solving problems, debugging, and spending hours trying to figure out why something doesn’t work when it should. You’ll hit walls. A lot.

It’s easy to get hung up on improving your coding skills. And yeah, that’s important. But here’s the thing: there’s always more to learn. There’s always a new framework, a new language, or a new tool. If you’re chasing mastery of every new thing that comes along, you’ll burn out. I’ve been there.

But if you’ve built resilience, you’ll roll with it. You’ll accept that not knowing everything is okay. You’ll focus on solving the problem with what you do know and trust that you can figure out the rest along the way.

Let me share a story. At a previous job, we were launching a feature that was key to our product. We pushed it to production, and boom—the system crashed. We had users depending on us, and I had to figure out what went wrong.

What did I do? First, I didn’t panic. I took a deep breath and started debugging. Turned out, we had a race condition in our code. Here’s a simplified example of what we were dealing with:

// A simplified race condition example
let usersCount = 0;
function incrementUsers() {
// Multiple threads were updating the users count at the same time.
usersCount += 1;
}
setTimeout(incrementUsers, 100);

When two parts of the system try to update usersCount at the same time, the result becomes unpredictable. It took a while to figure out the issue, but staying calm and methodical is what got us to the solution. Mental toughness.

So how do you build this toughness? It’s not something that happens overnight, but there are a few things I’ve found helpful:

  • Accept failure as part of the process.

If you’re learning, you’re failing. That’s just how it works. The faster you come to terms with this, the less stressful it becomes.

  • Break problems into smaller pieces.

When you’re stuck, break the problem down. Focus on the first small thing you can fix and build momentum from there.

  • Practice problem-solving under pressure.

Take on challenges that make you uncomfortable. Push yourself. The more you practice solving hard problems, the less daunting they become.

  • Step away when needed.

Sometimes, walking away from a problem for a few minutes (or even hours) is the best way to clear your head. Come back fresh.

  • Surround yourself with people who challenge you.

This one’s important. If you’re always the smartest person in the room, you’re not growing. Surround yourself with peers who push you to improve.

At the end of the day, the best developers aren’t necessarily the ones who know the most. They’re the ones who can keep moving forward when things get tough. Mental toughness is what will keep you going when the bugs pile up, the deadlines are tight, and everything seems like it’s going wrong.

So, if there’s one thing to focus on as a developer, I’d argue it’s not your coding skills, but your mindset. Build resilience. Build mental toughness. It’s the best tool you can have in your dev toolkit.

If you found this article helpful, you might enjoy my free newsletter. I share developer tips and insights to help you grow your skills and career.


More Articles You Might Enjoy

If you enjoyed this article, you might find these related pieces interesting as well. If you like what I have to say, please check out the sponsors who are supporting me. Much appreciated!

Webdev
6 min read

Inside the CSS Engine: CSSOM Explained

A deep dive into how browsers parse and manipulate CSS, its impact on web performance, and why it matters

Oct 25, 2024
Read article
Webdev
4 min read

Programming Trends to Watch in 2020 and Beyond

Here are my bets on the programming trends

Jul 19, 2019
Read article
Webdev
4 min read

Speed Up Your Website With rel='preconnect' and increase PageSpeed Insights Score

Using link rel='preconnect' can improve your website's performance by reducing connection setup times to key external domains.

Sep 13, 2024
Read article
Webdev
3 min read

scrollbar-width & scrollbar-gutter: CSS Properties for Layout Control

Prevent content shifts and refine scrollable UIs with scrollbar-width and scrollbar-gutter

Dec 19, 2024
Read article
Webdev
5 min read

WebAssembly (Wasm): When (and When Not) to Use It

Understanding the real use cases for WebAssembly beyond the performance hype

Nov 25, 2024
Read article
Webdev
7 min read

What Does an Entry-Level Programmer Need to Know Exactly?

Expectations for entry-level programmers

Nov 6, 2019
Read article
Webdev
3 min read

Preloading Responsive Images

How to properly preload responsive images to improve initial page load

Nov 28, 2024
Read article
Webdev
3 min read

The HTML Native Search Element

The search HTML element is a container that represents the parts of the web page with search functionality

Dec 2, 2024
Read article
Webdev
3 min read

CSS ::target-text for Text Highlighting

A look at how browsers can highlight text fragments using CSS ::target-text, making text sharing and navigation more user-friendly

Dec 17, 2024
Read article

Become a better engineer

Here are engineering resources I've personally vetted and use. They focus on skills you'll actually need to build and scale real projects - the kind of experience that gets you hired or promoted.

Many companies have a fixed annual stipend per engineer (e.g. $2,000) for use towards learning resources. If your company offers this stipend, you can forward them your invoices directly for reimbursement. By using my affiliate links, you support my work and get a discount at the same!


This article was originally published on https://www.trevorlasn.com/blog/mental-toughness-is-the-best-quality-a-developer-can-have. It was written by a human and polished using grammar tools for clarity.