#ToggleTalk: 🛠 Troubleshooting and Debugging 🐛
Tags: troubleshooting, debugging, community, toggletalk
Published: 2020-04-25 23:12:04

---
title: #ToggleTalk: 🛠 Troubleshooting and Debugging 🐛
published: true
description: A weekly chat recap with the advocates from LaunchDarkly about software development topics
tags: troubleshooting, debugging, community, toggletalk
series: ToggleTalk
---

## Recap
This week we talked about troubleshooting and debugging; Toggle and I love to talk about this stuff! Since we did [resiliency](https://dev.to/launchdarkly/toggletalk-3-resiliency-3734) last week, we wanted to continue to weave in the steps we have in software development. Often, we only look at these things when something goes wrong; however... we think it’s so much more. It’s a core part of what we need for discovery and growth. When we talk with junior engineers, this is one of the first things we are looking for beyond language knowledge. When you’re presented with a problem, what are the steps you take to try and solve it? From that challenge, comes a conversation. The conversation can delve into tools, processes, and general ideation on how to handle problems. When we posed [that theme](https://twitter.com/jessicaewest/status/1253068287224672256?s=20) this week, we got a lot of responses! 

## Questions
😂 What’s the weirdest bug you've encountered?
🛠 Have a favorite debugging tool/process?
💡 Biggest lesson learned from debugging?
👩‍🏫 Fundamental beliefs on the debugging process
😫 Advice for when people get stuck?

# Highlight Reel

### Simple can be best
When you're just getting started and need to see what is happening, sometimes a quick `console.log()` can be just what you need. Regardless of your editor, you always have this available to you. Not fancy, not quick, and you’ll need a few of them – but they’ll get the job done!

<blockquote class="twitter-tweet">
<p dir="ltr" lang="en">&#x1f6e0; Have a favorite debugging tool/process?</p>
console.log(JSON.stringify(obj, null, 2))

I know it's not fancy, but it work &#x1f605;

— Carter Rabasa (@crtr0) <a href="https://twitter.com/crtr0/status/1253069946109616128?ref_src=twsrc%5Etfw">April 22, 2020</a></blockquote>


### TIL
On the flip side of this discussion: our Developer Advocate, [Yoz](https://twitter.com/yoz), kindly pointed out all the debugging tools we had available to us beyond print statements. What was great about this response, was not only did he talk about why, but he gave us a demo. (No, he was not prepped ahead of time – he is just that plugged in!) 

<blockquote class="twitter-tweet">
<p dir="ltr" lang="en">The problem is that adding *one* console.log() might be quick.
But it’s almost never just one. That screenshot has at least FIVE, including the type that feels the most shameful whenever you have to use it:</p>
if (...) {
console.log(“yes we went down this branch OK”)

— Yoz Grahame (@yoz) <a href="https://twitter.com/yoz/status/1253105132775936002?ref_src=twsrc%5Etfw">April 22, 2020</a></blockquote> 

### Advice
One of the amazing things about community in general, which we love, is helping each other out. This week we heard from a lot of people on the advice column, regardless of experience, how you can move past a problem! We heard everything from naming variables, to process and (literally) changing your environment. 

<blockquote class="twitter-tweet">
<p dir="ltr" lang="en">My main tips for people learning:</p>
Have a project - actually build something. You learn so much more than learning in abstract.

If you're struggling with some code, extract that code out on its own. Get it working, then apply what you learned in the larger codebase.

— Judy2k (@judy2k) <a href="https://twitter.com/judy2k/status/1253146660227764227?ref_src=twsrc%5Etfw">April 23, 2020</a></blockquote>

<blockquote class="twitter-tweet">
<p dir="ltr" lang="en">Experiment as you learn, give variables meaningful names, with Python 3.7 make use of type hinting.</p>
— shawn (@sbmccarth) <a href="https://twitter.com/sbmccarth/status/1253077241229164546?ref_src=twsrc%5Etfw">April 22, 2020</a></blockquote>

<blockquote class="twitter-tweet">
<p dir="ltr" lang="en">My biggest lesson, fundamental belief, and my best advice if you're stuck debugging is: Changing your view often leads to an answer!</p>
Ways to do that:

&#x1f6b6;&#x200d;&#x2640;&#xfe0f; Take a walk around the block
&#x1f986; Try explaining your issue out loud
&#x1f440; Look for similar problems
&#x1f469;&#x200d;&#x1f4bb; Change your color scheme <a href="https://t.co/fsSI8Ub50m">https://t.co/fsSI8Ub50m</a>

— Ryan Lynch (@shiftyp) <a href="https://twitter.com/shiftyp/status/1253079028812189701?ref_src=twsrc%5Etfw">April 22, 2020</a></blockquote>

### People and Processes first
This was a real treat: Jennifer graciously gave us an amazing thread on all things debugging. However, we want to highlight a few key items here which no one else quite keyed into. Beyond the actual tools we use for debugging, we need to take a step back and look at the people and environment we set for developers to debug and write code in the first place. This involves training, empowering, and sharing knowledge with your team. More importantly, as a leader, be sure to not take the problem on as an individual, even if you are the most qualified. Use this as a teaching moment, and distribute the workload. It opens up the problem to be solved in a different way, and gives an opportunity for your team to learn.

<blockquote class="twitter-tweet">
<p dir="ltr" lang="en">One of my fundamental beliefs about debugging is that you have to be prepared. If you are new to a company/environment/technology, you need to talk to folks and build up the set of tools and techniques that apply. <a href="https://twitter.com/hashtag/ToggleTalk?src=hash&amp;ref_src=twsrc%5Etfw">#ToggleTalk</a></p>
— Jennifer Davis (@sigje) <a href="https://twitter.com/sigje/status/1253073050888581120?ref_src=twsrc%5Etfw">April 22, 2020</a></blockquote>

<blockquote class="twitter-tweet">
<p dir="ltr" lang="en">So the "what to use" isn't super interesting, but we had looked at TONS of tcpdumps prior to this. Having the space/time to do so while not also dealing with the intricacies of high impact incidents was critical to figuring out what happened <a href="https://twitter.com/hashtag/ToggleTalk?src=hash&amp;ref_src=twsrc%5Etfw">#ToggleTalk</a></p>
— Jennifer Davis (@sigje) <a href="https://twitter.com/sigje/status/1253078335875252224?ref_src=twsrc%5Etfw">April 22, 2020</a></blockquote>
<blockquote class="twitter-tweet">

<p dir="ltr" lang="en">Next, I worked on leveling up everyone on the team to be able to recognize the symptoms so that we could minimize the impact of the stampede. This meant coordinating response and NOT immediately doing all the work myself. <a href="https://twitter.com/hashtag/ToggleTalk?src=hash&amp;ref_src=twsrc%5Etfw">#ToggleTalk</a></p>
— Jennifer Davis (@sigje) <a href="https://twitter.com/sigje/status/1253075903992610817?ref_src=twsrc%5Etfw">April 22, 2020</a></blockquote>

### A Funny
Well, we only got one funny story this week (darn it!), but we found it doubly funny as it had a recursion irony involved. By trying to debug, they wrapped the entire method in an `if` debug enabled case, which caused the program to not start in production and well, you can imagine that didn’t work well. Maybe a case for LaunchDarkly to do this test in production… 😏

<blockquote class="twitter-tweet">
<p dir="ltr" lang="en">Oooohh a fun bug, speaking of logging. Many moons ago we worked with a junk logging framework where debug was really slow even if it was not logging. So we would check for debug with an if. When in dev the app worked when in prod, Nope. The if wrapped too much code causing a bug.</p>
— shawn (@sbmccarth) <a href="https://twitter.com/sbmccarth/status/1253074286732095489?ref_src=twsrc%5Etfw">April 22, 2020</a></blockquote>

## Summary
This is a big theme and one that we probably could have talked about all week! Troubleshooting and Debugging are at the core of what we do as developers. Oftentimes, we can spend more time troubleshooting something than we do writing lines of code. One of my teammates said it best, “Writing 10 lines of code in a day, truly is a victory.”

## Want more?
Guess what? We run this each week and if you missed it this week, we’d love to hear from you next week! We’ll change the topic and let you know through the hashtag #ToggleTalk. Please join us if you can, next Wednesday! Sneak peek… we’re going to be talking about _Chaos Engineering_. And if Twitter is not really your thing, you could check out our Test in Production [Twitch Stream](https://www.twitch.tv/test_in_prod), featuring [Casey Rosenthal](https://twitter.com/caseyrosenthal?s=20) as our guest next week! 

<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>