Get better at debugging

The following actions you can take to get better at debugging

  1. learn the codebase
    You can’t debug code without understanding how it works, learning the codebase happens naturally over time. Debugging is also the best way to learn, seeing how something breaks helps you learn a lot about how it works
  2. learn the system
    For example, if you’re a backend web developer, some “system” knowledge you might need includes:
    • how HTTP caching works
    • CORS
    • how database transactions work
  3. learn your tools
    Debugging tools –
    • debuggers (gdb etc)
    • browser developer tools
    • profilers
    • strace / ltrace
    • tcpdump / wireshark
    • core dumps
    • and even basic things like error messages (how do you read them properly)
  4. learn strategies
    • writing a unit test
    • writing a tiny standalone program to reproduce the bug
    • finding a working version of the code and seeing what changed
    • printing out a million things
    • adding extra logging
    • taking a break
    • explaining the bug to a friend and then figuring out what’s wrong halfway through
    • looking through the GitHub issues to see if anything matched
  5. get experience
    I’ve had SO MANY bugs that were really frustrating and difficult the first time I ran into them, and very straightforward the fifth or tenth or 20th time

Read the full blog here – Some ways to get better at debugging

2 thoughts on “Get better at debugging

Leave a Comment