Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
hack64144yHere is my 2 cents: use chrome remote debuggin, you can also run js snippets while debugging to see different outputs. It saves tons of time when you are trying to fix bugs that takes too much time to reproduce.
https://code.visualstudio.com/blogs... -
neeno31484y@hack ooOo that's nice, I'll definetely check it out, but the problem is that most of the time I'm too lazy to configure the debugger, so I just use console.log :p
Ironically enough, I end up taking more time adding and removing log statements than I would if I took 10mins to figure out how to configure the debugger and actually used it. -
Hazarth94844yTo be fair, I think knowing how to debug using console logs (in any language) is an extremely valuable skill... Debuggers are fine but there are some things to consider imo:
1. Putting console logs all around might give you a good idea where you should actually leave console logs for an actual debug mode, so you can ask users for debug logs if something goes wrong
2. Especially in multithreaded environment (or with a lot of Timeouts) it's sometimes much easier to follow a stream of text logs than the actual madness happening inside the computer
3. even in single-threaded apps, it's still sometimes nice to let the code run fully and then read the output to get a good understanding of what's happening, even if the logs are literally log("here"), log("here2"), log("here3")
4. What if you're in a situation without an IDE and internet connection but you still wanna code?! You better know how to use those logs well :P -
neeno31484y@Hazarth agreed, knowing how to figure out what the code is doing only with logs is a good skill to learn. However, sometimes it's way easier and less time consuming to just use the debugger, so it's also good to know how to use it.
-
Tonnoman6224yIt's a good option if you have nothing but a bare bones editor to your disposal for some fucking reason
-
neeno31484y@Tonnoman0909 lol at that point you're working like a caveman, not just debugging like one
-
I normally don't use debuggers because I can read code, understand what it does, then fix the issue. This helps not only to write fewer bugs in the first place, but also to do code reviews and spot even potential bugs and lurking robustness issues.
What I find outright ridiculous is the sort of devs who need a debugger in single step mode to figure out what their own fucking code is even doing. Hilarious. Also, it's really no particular skill to set some breakpoints or watchpoints with a mouse click.
For the exceedingly rare cases where some shit is so obscure that a bug manifests somewhere completely else, I use raw command line GDB because I just can't be bothered to fire up some bloated piece of IDE shit.
Related Rants
-
Dacexi24When there are only 2 pages on Google you know you're in serious shit.
-
practiseSafeHex20Fixing a parents iPhone, episode 1. Problem: "Whatsapp is gone off my phone" Debugging: Me: *unlocks phone...
-
nachocode6When you talk to other devs about what their code did. I also relate myself to this.
Bad dev habit: using a bazillion console.log/println like a caveman instead of using a proper debugger.
rant
debugging
wk255