upvote
I've seen more than one half-joke-half-serious chunk of code that would "encode" arbitrary info into stack traces simply by recursively calling `fn_a`, then `fn_s`, `fn_d`, and `fn_f` before continuing with the actual intended call, giving you a stack trace with (effectively) "asdf" in it.

They've also been useful more than once, e.g. you can do that to know what iteration of a loop failed. There are of course other ways to do this, but it's hard to beat "stupid, simple, and works everywhere" when normal options (e.g. logs) stop working.

reply
Reminds me of https://github.com/jtolio/gls which implement a "thread local storage" in golang
reply
Well you're doing gods work as far as I'm concerned. Conflating difficulty in practice with impossibility in principle is, to my mind, a source of so much unnecessary cognitive error.
reply
The declaration of an impossibility of a given task or goal is a reflection of the perceived barrier by the individual, rather than the task itself.
reply
Wise men speak when needed; fools because they want
reply
Similarly, one of the great things about Python (less so JS with the ecosystem's habit of shipping minified bundles) is that you can just edit source files in your site_packages once you know where they are. I've done things like add print statements around obscure Django errors as a poor imitation of instrumentation. Gets the job done!
reply
The solution to every software problem is another layer of indirection :-)
reply
Adversarial software development is also when I do my best work
reply
Adversarial personal development is definitely a thing too.
reply