Whenever I use print for debugging I end up running the code many, many times. Each time I add another print statement. "Here1", "Here2", "Here3 %s %s %s"...
If I break out the debugger, I run the code once.
If I break out the debugger, I run the code once.
Another use case for printf debugging is occasional or transient issues where there is a bug, but it only presents in an aggregate of many runs (or a lot of runtime).
I debug scientific simulations in this way with printf's, because I need to look across 100 log files to find 2 or 3 instances of a bug.
Then I can reproduce it and zoom in on the exact problem with either more logging or a debugger.
It’s setup time that pays dividends for years afterwards.
I think many folk don’t bother until they need to fix a bug and at that point you are in a sunk cost situation.
(I still use print statements 99.99% of the time though)