|
|
|
|
|
by ceronman
289 days ago
|
|
I used to agree with this, but then I realized that you can use trace points (aka non-suspending break points) in a debugger. These cover all the use cases of print statements with a few extra advantages: - You can add new traces, or modify/disable existing ones at runtime without having to recompile and rerun your program. - Once you've fixed the bug, you don't have to cleanup all the prints that you left around the codebase. I know that there is a good reason for debugging with prints: The debugging experience of many languages suck. In that case I always use prints. But if I'm lucky to use a language with good debugging tooling (e.g Java/Kotlin + IntelliJ IDEA), there is zero chance to ever print for debugging. |
|