> Most - maybe all - professional programmers I've worked with spend longer in the debugger or inserting and reading logs
Don't say debugger! A debugger is a tool of last, last, last resort. It only helps for an instant! It doesn't build durable assurance of correctness for you or your team; and the knowledge you gain only helps once. It's a super low leverage use of time.
Your limited time and energy should produce durable assurances of quality in your work. Consider replacing with these practices -
1. Test-driven Development (TDD, red/green/refactor.. it has many names)
Write the tests first; witness the tests fail, confirm they're failing for the right reason (not some irrelevant issue like missing imports) and only then move on to implementation. If you're putting tests in for code that already works, modify the production code to break it; witness the tests fails. Make 100% sure those prove what you think they do, because a test that has never been seen to fail is not only useless it's a risk that you left lies forever in your codebase.
2. End-to-end testing and the testing pyramid
Write end to end tests. Exercise as much of the system's architecture as possible in a closed container (eg. with a browser test framework like Playwright, and a container orchestrator like docker compose)... but since that's slow at the scale of a real product only cover the happy path. Defer to unit, feature, and integration tests for the rest, because smaller tests can remove all I/O, not test third-party code, and have injected dependencies - and thus, run in parallel under a millisecond. End to end tests don't have that luxury; hence, testing pyramid.
3. User Acceptance Testing
Which stakeholder(s) declare your implementation meets the original requirements? Put them in the process before release. They should confirm business and technical compliance with what you were supposed to build, and help catch more bugs before production
4. Feature-flags, A/B tests, and smaller, more frequent releases
Release more often, so each change can be smaller, spreading the risk of releasing out over many releases instead of one "big bang" (you know why we call them big bang releases right? because that's what they do) .. Hide work behind feature flags that ready to be enabled, then when it's ready, unleash it on the world in an instant. Bug with the work? Roll back the feature flag. Amazing.
5. Observability.
Make it possible to understand in the present moment as well as forensically what is happening in your product. Add traces, emit metrics, plan out logs to insert ahead of time (any time a metric won't suffice), add in product usage metrics to see where people are dropping out/getting confused and improve those things, and any other
6. Load testing, fuzz testing, security testing, performance testing, fault-injection testing
Most products have requirements that'll drive these and many other types of testing. Don't do a once-off test & fix. Produce harnesses and artifacts - and include them for the next person to pick up where you left off. Even better make these tests continuous and put them into your process - ie. in CI.
All preventative stuff that should helps keep that debugger at bay. In conclusion: say no to debuggers!
I’m not gonna argue against the importance of testing, but what you described here is completely orthogonal to the use of a debugger. If anything, it would be step 0 of your hierarchy. After all, you have some code that’s has unexpected behavior, debugger is how you figure out how to write a failing test case in the first place.