by xnorswap · 2y ago · 0 comments
I don't think I'd be anywhere near as productive without:
- Conditional breakpoints
- Debugger.Launch
- Debugger.Break
- Debugger.Write
Conditional breakpoints are essential, just run as normal and it'll only break when your bizarre edge case is hit.Debugger.Break and Debugger.Launch are like a breakpoint that gets hit even when you're not debugging, and prompts you to attach a debugger. ( Launch won't pause if you already have one attached, but especially useful when you want to attach to a start-up routine in an IIS hosted web-app. )
Debugger.Write writes to a different output stream, and like all Diagnostic.Debug statements, isn't even compiled into release builds, so there's zero chance of it ending up in prod.
These are essential tools for rapid debugging. Printing nonsense and hoping to spot it feels 20+ years out of date.
The point I was trying to make is that you shouldn't be print debugging in 2024.
My experience in cpp is 5 times worse than in .net
.., the world runs off print statements sprinkled throughout by a very frustrated and angry developer
And we should also teach them not to get their delicate timing out of whack because they'll immediately stop dropping incoming samples if any of them gets interrupted by a debugger.
I'm sure everyone will be delighted.