News for hackers. Stuff that matters.
Re:The Grug Brained Developer (2022) by profsummergig on Wednesday June 18, 2025 @12:44PM (#44311403)
I want to master JS/React and Python debugging. Am an "advanced beginner" in both. What tools do you recommend?
Re:The Grug Brained Developer (2022) by steve_adams_86 on Wednesday June 18, 2025 @01:22PM (#44311704)
For JavaScript, you're actually able to debug fairly easily by default by adding a `debugger()` call in your code. Browsers will stop at that call, and start the debugger.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Another way (and probably a better idea) is creating a launch definition for VS Code in launch.json which attaches the IDE's debugger to Chrome. Here is an article describing how that works: https://profy.dev/article/debug-react-vscode

Breakpoints are nice because they can't accidentally get shipped to production like debugger calls can.

For Python I essentially do the same thing, minus involving Chrome. I run the entry point to my application from launch.json, and breakpoints in the IDE 'just work'. From there, you can experiment with how the debugger tools work, observe how state change as the application runs, etc.

If you don't use VS Code, these conventions are similar in other IDEs as well.