7 ms·
I used to debug frequently when I coded on Win32 GUIs 20 years ago and running the debugger was as simple as pressing F5 instead of F9. Nowadays, with a multitu
by sph 4y ago
I used to debug frequently when I coded on Win32 GUIs 20 years ago and running the debugger was as simple as pressing F5 instead of F9. Nowadays, with a multitude of languages, setups and editors, I don't even bother. Even setting up JS debugging under VSCode, which supposedly is a core feature, has always been an exercise in frustration every time I've tried it.
Rarely I run gdb when I'm debugging a particularly hairy C issue, but with any other language I don't even bother and add prints everywhere. The JS "debugger" statement is pretty useful, but it's still very awkward compared to the golden standard of Microsoft IDEs from two decades ago.
Don't blame the users, blame the tooling, editor and language developers that never cared for delivering a good debugging experience.
- SergeAx 4y agoAt least Go debugging in Jetbrains' Goland is a smooth and effective experience, on the other hand. I think their other language IDEs are more or less on par.
- RcouF1uZ4gsC 4y agoI too got spoiled by Visual C++’s debugger. Nothing on other platforms combines the power and ease of use.
- anamax 4y agoVisual C++'s debugger is so good that it changed how I wrote code. It let me debug things that I couldn't debug with a lesser tool. That's why I quit using it and went back to debugging with print. Print-debugging limits my cleverness and forces me to think about what's going on.
- DeathArrow 4y agoDebugging C# in Visual Studio is at least as good.
- carlmr 4y agoVisual Studio is plainly the best IDE I've ever worked in. It may be sluggish at times, but whether I was coding in C#, C++ or Python, autocompletion, debugging, and refactoring always worked really well. The only problem is my current projects are all on Linux.
- tialaramex 4y agoMy current role is mostly done by Windows people (my direct boss is a Windows guy, although his boss runs Linux at work) and I took it while interactions were minimised due to COVID so we decided I should run Windows on the work laptop. So I figured "When in Rome" and I have Visual Studio and I expected I would come away saying this is pretty cool but I want a modal editor. Nope, it's terrible. It does have a debugger that is better than I'm used to, but I spend very little time in a debugger, what we're doing isn't rocket surgery. Visual Studio apparently doesn't understand how git works or doesn't understand how files work, so e.g. I'll modify somefile.cs in one tab to fix something, compile, verify my fix worked, go to the Git tab and Visual Studio is wide-eyed. What could I want? There aren't any changes. Yes there are VS, you just saved them, to a file. So I exit VS and restart it. "Oh!" realises Visual Studio, somebody changed the file. Yes, it was you. You wrote to the file, when I hit save. That's what files are Visual Studio, why is this hard? Now I can commit my change. C# is a much better language than I expected, PowerShell is a much worse language than I expected. Lots of surprises, good and bad, but I think "Visual Studio is bad at the thing it's for" was the largest surprise.
- Ygg2 4y agoTry Jetbrains Rider. It's miles ahead of VS, but don't expect a miracle.
- ccouzens 4y agoJust because you're using an IDE doesn't mean you can't use a second tool simultaneously. It sounds like using a second program to add and commit files to git would work better for you. (I've not spent much time with visual studio)
- cmroanirgo 4y agoI don't disagree, but borland c++ and turbo pascal both had excellent debuggers, the latter is still working under the guise of lazarus (but i'm not a fan of the gui). What spoiled me in vc++ was remote debugging, statement completion & type/object browsers.
- inglor_cz 4y agoI worked both in Visual C++ and in phpStorm+XDebug and I liked the latter more. For MSVC, I had to write some visualization files (.natvis), phpStorm displays everything just fine.
- 8note 4y agoI've found vscodes js debugging to be really straightforward. You open a their terminal, place some breakpoints, then run any command you want.
- dc-programmer 4y agoDropping in a import pdb; pdb.set_trace() in my pytests and running them from the terminal has helped me squash some pretty difficult bugs. It’s dead simple (same with Ruby pry)
- animal_spirits 4y agoSince python3.8 you can just call `breakpoint()` and it does the same as `import pdb; pdb.set_trace()` Also since were on the topic I started using pdb++ and my debugging got incredibly more efficient. https://github.com/pdbpp/pdbpp https://github.com/pdbpp/pdbpp
- dc-programmer 4y agoNice recs, I’ll have to check pdb++ out. Another tip is to add —-pdb to pytest so that it starts the debugger on each test failure.
- solarmist 4y agoYou should check out ipdb too. That’s my recommendation.
- solarmist 4y agoI like ipdb over pdb. All of the niceties of ipython when debugging. If you export `PYTHONBREAKPOINT=ipdb.set_trace` you can use this ipdb too.
- toomanydoubts 4y agoI also wanna give a shout out to pudb, for those who want a more visual experience. It uses curses to offer a GUI-like debugging experience while on the terminal. Real nice piece of software.
- icedchai 4y agoI do this all the time! I also do this when writing code, like if I'm getting some json blob from an API call, and I'm not quite sure what it is...
- kristopolous 4y agoJavaScript's remote debugging protocol is a total game changer. Highly recommend looking into it. And yes you can use it on frontend stuff if you invoke your browser correctly And yes you can use it to debug mobile through chrome's inspect feature. And yes you can proxy that to use it in your editor of choice and yes GUD with emacs is supported And yes the "debugger" keyword correctly triggers the breakpoint through this entire pipeline. It's borderline magic
- dzhiurgis 4y agoUsed to be ndb index.js But node debugger died at some macos release and I haven’t figured anything close to it.
- hoten 4y agondb definitely stills works for me on Mac. But these days, I just use VS code. Open a special JS terminal (https://imgur.com/a/nqEFYkz https://imgur.com/a/nqEFYkz), then the debugger will auto-attach to any Node process run in that terminal.
- dzhiurgis 4y agoIIRC it was one particular aspect, maybe it playwright or other third party tool that was crashing it. Thing that's nice with ndb it's the same UI as Chrome devtools that I'm so used to. Debugging via Webstorm felt too weird (tho probably 2x more powerful). Not a VSCode user.
- cmroanirgo 4y agoRemote debugging is not new. I was doing it with vc++ back in the early 00's, & am pretty sure was there in the 90's.
- kristopolous 4y agoOf JavaScript? Really? The concept of remote debugging is just one of instrumentation, that's from the 1960s, this isn't a conceptually new thing. It's a functionally useful one
- gonzo41 4y agoMy current pain point trying to get python debugging working on vscode remote with containers. So sadly, lots of print(f"")'s
- strictfp 4y agoJetbrains IDEs are just as good as Visual studio. As is XCode, QT creator and friends. And they work with many languages. I know it's a problem with Python and Node though.
- ur-whale 4y ago> Jetbrains IDEs are just as good as Visual studio. As is XCode, QT creator and friends. And they work with many languages. Do these support edit and continue? Last I played with XCode, it didn't. Major flaw.
- tempura_1245 4y agoJetbrains - yep. Both edit variable and hot reload code.
- brabel 4y agoA common thing I do is find the problematic code using the IntelliJ debugger, change the code, press Cmd+F9 to reload the function code, hit "drop frame" so the executing code goes back to the previous function in the stack (the caller function) so the edited function can execute again with the new code. While at it, you can also change the value of any visible variable and evaluate any expression in the context of the currently executing scope.
- Ygg2 4y agoTry debug a racing issue with debugger. If you use it, issue dissapears, if you don't issue it's there. Using print is a sign tooling isn't up for the task. Not necessarily inexperience.
- whynotminot 4y ago> Using print is a sign tooling isn't up for the task. Not necessarily inexperience. This. For application developers, if your users aren't taking advantage of features in your software, it's a sign the features either aren't actually better, or aren't intuitive enough to gain traction. It's a tell that you still have work to do. I don't see why the same arguments wouldn't also apply to tools for developers like debuggers. Just because your userbase is more technically savvy doesn't mean you shouldn't care about ease of use.
- raverbashing 4y agoYes, half the blame is on the languages I wish there was a 'here be dragons' statement that you could put and it would run a function or a snippet on a special debugging mode (without the need for a debugging tool). And then ask questions like "who set this to value X" or "just print the local vars here" etc I think the closest we have to this are the debugging environments that (for example) Flask gives you (maybe other frameworks)
- johnchristopher 4y agoThat's basically how breakpoints work in python, right ?
- TheOtherHobbes 4y agoThere's a stack frame and you can watch on variables to trigger the debugger when they change. But there's no operation tracing. I'm not aware of any language/system that automatically logs all operations with their context/value and boils that down to a useful display. Debuggers seem to all use the ancient machine code model where they replace an instruction with "And now launch the debugger to see what state the variables, memory, and registers are." It would be useful to have more print-like features that create a searchable list of all entries/exits/creators/destructors in sequence with associated parameters and values.
- kaba0 4y agoThere are even time traveling debuggers that can reverse code flow, so I’m sure something similar exists.
- Tomis02 4y ago> Don't blame the users, blame the tooling, editor and language developers that never cared for delivering a good debugging experience. Do blame the users. If they would've said "nah, I'm not using your programming language, it doesn't have a decent IDE and debugger", life would be much better.
- Dudeman112 4y agoI have a feeling no programming language would ever be used anywhere if we were just as strict with other aspects besides "having decent IDE and debugger"
- Datenstrom 4y agoName one thing an IDE can do that I can't do with my (Turing complete) editor and shell.
- speed_spread 4y agoAn IDE can let another programmer learn the project without you being there to explain the details of your bespoke tooling.
- Datenstrom 4y agoMy bespoke tooling does not require anyone else to use it to navigate or learn any project unlike some IDEs which is the biggest problem with them.
- akrymski 4y agoIt's hard to imagine that 20 years ago Delphi and Visual Basic had far superior IDEs and debugging experience running on my 100 MHz IBM PC with 512MB of RAM. I'm not sure where the ecosystem went wrong, but it's strangely related to the web.
- andreskytt 4y agoIt went wrong, when young nice folks with fresh MBAs realized, that the point of diminishing returns for software quality can be very low. Just throw things into production and maybe catch some of the bigger foobars and let the hockey stick growth take over. Yes, you’ll loose some customers but more will come and it’s just not worth it spending time on shifting the exponent slightly to the left. Your evaluation will depend more on the exciting new features rolled out than the 3-per-cent-lower-than-predicted au growth.
- kaba0 4y agoJava IDEs still have the best tooling when it comes to debugging/observability, in my humble opinion so at least progress is not lost in every ecosystem.
- gattilorenz 4y ago> 100 MHz IBM PC with 512MB of RAM What kind of a strange beast was that? :) I do remember fondly debugging in Delphi, but when using Perl and Python's debuggers I don't really miss it
- zmmmmm 4y agoIt's a casualty of the orgy of complexity we've indulged in for the last 15 years. You're absolutely right, we had all this stuff 20 years ago.
- mixmastamyk 4y agoThirty+, I stepped through code in char mode DOS.
- G3rn0ti 4y agoConnecting the chrome debugger to a nodejs backend is pure luxury. I think it could compete with the M$ experience easily.
- ericmcer 4y agoJS debugger was amazing a few years ago. I find it struggles with the transpilation and functional elements of debugging something like a Typescript React app with multiple hooks and async operations. Stepping through the code and setting breakpoints doesn't work as expected in some cases and I revert to just slapping console.logs() everywhere to trace execution.
- lloydatkinson 4y agoIt’s still exactly the same in Visual Studio today for .NET or C or C++. Super easy to do.
- vinyl7 4y agoAnyone frustrated with debuggers, check out RemedyBG https://remedybg.itch.io/remedybg https://remedybg.itch.io/remedybg Insanely fast and capable debugger for Windows. https://www.youtube.com/watch?v=r9eQth4Q5jg https://www.youtube.com/watch?v=r9eQth4Q5jg (I have no relation to the project, just think it's great)