upvote
Assuming you meant C's printf, why would you subject yourself to the pain of recompilation every time you need to look at a different part of code? Isn't the debugger easier than adding printf and then recompiling?
reply
Do you use snippets or something to help speed this up? Manually typing `printf("longvarname=%s secondvarname=%d\n", longvarname, secondvarname);` adds up over a debugging session, compared to a graphical debugger setup with well-chosen breakpoints, watches etc.
reply
It really doesn't? I mean, sure, typing is slower than clicking (though only marginally as complexity grows, there's a lot of clicking needed to extract the needed state, and with printf I only need to extract it once and it keeps popping out as I rerun the test).

But I spend far more time reading and thinking than I do typing. Input mechanics just aren't the limiting factor here.

reply
The first thing I always do is define log. It's bonkers to use console.log() for js. a simple window.log=console.log.

Secondly, in your example, no need to label the names. This is almost always understood by context. So, pretty manageable. e.g. in JS: log(`${longvarname}, ${secondvarname}`)

reply
LLMs have mostly made this trivial, plus you have the added benefit of being able to iteratively dump out more each run.
reply
This is a solid answer.
reply