this post was submitted on 07 Jul 2023
1918 points (98.3% liked)
Programmer Humor
32453 readers
1022 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Ten years into casual programming and I still don’t know how to use a debugger.
I believe in a conspiracy theory that nobody uses debuggers.
I work with 20 year old legacy spaghetti code, the debugger has become one of my most treasured tools.
Grep log will outlive us all
console.log
counts as “a debugger”, right?It does for me!
Yes, but only because it gives you a link to where that was run. Click the link to the right with filename:lineNumber, and it will open the sources tab to that line. Set a breakpoint and rerun to pause there, then step through the code's execution.
Of course, if you're using minified or processed code, this will be more difficult, in that case figure out how to do it in VS Code.
I use them daily. It makes it so much easier to work with an existing code base
Yep. Once you get the hang of it, you will cringe to think of all the wasted effort that came before. But getting the hang of it takes dedication.
Thankfully I use python mostly and pycharm makes it easy-ish to get the debugger hooked up to a project. But learning that process definitely took a few days
Does this include C programmers? I've definitely found GDB to be indispensable in the past (or maybe that's what they would want you to think).
After decades of print debugging I finally got dap up and running in vim. It is very nice. Would recommend.
I can record a video tomorrow if it helps?
It’s easy, you just step, step, step, step in, or wait, over, or, oops.
Watch a Video or read something because it really is an invaluable tool. But here's a crash course:
Debuggers, or IDEs, let you step through your code in slo-mo so you can see what is happening.
There are many other things an IDE can do to help you, so def look into it more if you want to save yourself a lot of insanity. But this is a good starting point.
If you're developing for the web use F12 to open web tools, and when an error happens, click the file/line number to see that point in the Sources tab, and you can debug there.
That sounds really cool
Thank you for writing this out
The only real time I use a debugger is to tell me what line a default occured at.
It can be useful sometimes. Same for print. And logfiles.