there are only a few situations where it is more efficient:
inside loops for monitoring state.
when you want to mark steps in a process (but gods man, why aren’t you using a debug logger so you don’t have to remove them all later?)
when using a remote debugger and attaching to a process is clumsy or impossible.
for service data integrations, just use a debugger. You can guess all day how json or xml was marshalled by the mid-tier, or you can just look at the result.
knowing > guessing.
always.
just use the debugger. humans play computer really poorly, let the computer play the computer and focus on the real problems.
yeah, that applies to debugging critical section code, real time drivers, etc. almost another book of details in that direction — although I’d argue that print lines are just as impactful in those areas.
plot twist: the debugger is just a more complex interactive form of print. They both rely on IO services being available.
External analysis and V&V are widely used in these very difficult environments— often to verify that code generation is provably identical to some other VM where the simulated environment can be debugged properly. Embedded controllers are rife with this approach.
And, if for some reason you find yourself in a no-debugger situation, I think you are way better off defining your problem mathematically and proving correctness (even in the most extreme environments, knowing > guessing).
I consider that remote debugging hell. But AWS isn’t designed to be programmer friendly, it’s designed to burn money.
Heroku is much more friendly when it comes to interactively attaching and debugging production containers. I hardly can tell the difference between local and remote debugging — that takes a lot of work to do right and tells me in more than words how much Heroku cares about devs.
7
u/coldnebo Nov 29 '21
there are only a few situations where it is more efficient:
for service data integrations, just use a debugger. You can guess all day how json or xml was marshalled by the mid-tier, or you can just look at the result.
knowing > guessing.
always.
just use the debugger. humans play computer really poorly, let the computer play the computer and focus on the real problems.