5 ms·
I'm confused. Did javascript people not use a debugger before VS Code?
by miguelrochefort 10y ago
I'm confused. Did javascript people not use a debugger before VS Code?
- amadeusw 10y agoIt was console.log() all the way
- miguelrochefort 10y agoYou can't be serious.
- thenewwazoo 10y agoI'm not sure why not. AFAIK that's still your only option if you want to debug NodeJS code headlessly.
- miguelrochefort 10y agoWhat about conditional break points, call stack, time travel, watch list, live editing, etc?
- Ace17 10y agoWow, there are actually people using any of these?
- miguelrochefort 10y agoMore like all of these every day?
- laurencerowe 10y agoRunning 'node debug script.js' will drop you into the command line debugger. It's a little painful though as the command line debugger does not have support for moving up/down stack frames.
- AYBABTME 10y agoprintf-debugging is a fine way to debug a ton of cases, especially programs with concurrent components. The process of debugging step by step isn't necessarily superior or faster.
- wwalser 10y agoThe Chrome based dev tools have been an option for years using node-inspector. Had all of the basics that you would expect from a debugging. Breakpoints, step into/out/over, variables available at that location in the stack, REPL console etc.
- throw_away 10y agoIt was kind of a pain in my experience to use the Chrome debugger to be your main editor. I've not used VSC for this, but I imagine it's nice to not have to flip back and forth between tools.
- wwalser 10y agoI was responding to the claim that it console.log was the only way.
- ld00d 10y agoYou can debug in Chrome (or any other browser). For node, you can run node-inspector which uses a browser for debugging.
- maxxxxx 10y agoI am pretty to the javascript/node world. The debugging situation is pretty pathetic in my view. Most people I know use a ton of logging like we did with C/printf 25 years ago.
- wwalser 10y agoUsing awareness of how to use a debugger is a reasonable interview technique WRT javascript devs. In general, ignorance is not a pejorative but if a candidate walk into an interview claiming to be an expert and I find out that you debug in anger using console log, I'm calling bullshit. They're either very green or too lazy to have investigated the tools available. Jr devs are, obviously, another story. Read up on how to use node --inspect for newer versions of node or node-inspector for older versions. One common need that is a sad state of affairs in the Node world is performance tooling. It's available and competent professionals should invest in it once it becomes necessary but is a pain in the ass to setup and run.
- maxxxxx 10y agoAs usual in this industry there is a whole new generation of devs coming up that have forgotten stuff that has been standard for a long time. Then somebody implements this old stuff for the new tech and people think it's major innovation. I am sure soon somebody will create a node profiler.
- passive 10y agoSounds like a profitable model (introducing new devs to best practices).
- coldtea 10y ago>In general, ignorance is not a pejorative but if a candidate walk into an interview claiming to be an expert and I find out that you debug in anger using console log, I'm calling bullshit. Some of the best programmers advocate for printf over debuggers... And some of the crappiest programmers run around the debugger for hours with no idea what could be wrong in the program, stepping blindly here and there...
- wwalser 10y agoI don't know why there are so many non-answers or flat out incorrect answers to your question. Yes, js devs use debuggers and have for years. Firebug was created and popularized for browser js 10 years ago[1]. Node.js was released 7 years ago, got a debug option one year later using node debugger. It was CLI based and a bit shit. Tools which leveraged Node's debug protocol and Chrome's developer tools (node-inspector) for example were started 5 years ago[2]. Most recently some group associated (maybe on?) the Chrome team started creating a cleaner debug protocol and integrating directly with the Chromium project[3]. That's become the gold standard and is the standard way of debugging for Node 7+[4]. VSCode uses that protocol to offer debugging directly from the editor. 1. https://en.wikipedia.org/wiki/Firebug_(software) https://en.wikipedia.org/wiki/Firebug_(software) 2. https://github.com/node-inspector/node-inspector https://github.com/node-inspector/node-inspector 3. https://github.com/nodejs/node/pull/9028 https://github.com/nodejs/node/pull/9028 4. https://nodejs.org/api/debugger.html https://nodejs.org/api/debugger.html
- komali2 10y agoFor client code I'd use the chrome debugger constantly. I mean for debugging a node server. Maybe there was some way I didn't know about. There's the 'inspect' flag in node 6 now that prints out a link you can copy into your chrome browser to debug server node code.
- nobleach 10y agoSome of us used debuggers way WAY back in 2002. Venkman was the new hotness: https://en.wikipedia.org/wiki/Venkman https://en.wikipedia.org/wiki/Venkman Firebug quickly became the defacto later on. But telling your average web designer about breakpoints, stepping over and stepping into would cause their eyes to glaze over.