←back to thread

214 points Brajeshwar | 2 comments | | HN request time: 0.397s | source
Show context
lpapez ◴[] No.45087294[source]
This article goes completely against my experience so far.

I teach at an internship program and the main problem with interns since 2023 has been their over reliance on AI tools. I feel like I have to teach them to stop using AI for everything and think through the problem so that they don't get stuck.

Meanwhile many of the seniors around me are stuck in their ways, refusing to adopt interactive debuggers to replace their printf() debug habits, let alone AI tooling...

replies(8): >>45087363 #>>45087929 #>>45088042 #>>45088074 #>>45088303 #>>45088412 #>>45088809 #>>45090665 #
lordnacho ◴[] No.45087363[source]
> Meanwhile many of the seniors around me are stuck in their ways, refusing to adopt interactive debuggers to replace their printf() debug habits, let alone AI tooling...

When I was new to the business, I used interactive debugging a lot. The more experienced I got, the less I used it. printf() is surprisingly useful, especially if you upgrade it a little bit to a log-level aware framework. Then you can leave your debugging lines in the code and switch it on or off with loglevel = TRACE or INFO, something like that.

replies(4): >>45087621 #>>45089223 #>>45089326 #>>45089878 #
shmerl ◴[] No.45089223[source]
I kind of had the opposite experience. I used to rely mostly on printfs and etc. but started using debugger more.

printf doesn't improve going up and down the call stacks in the debugger to analyze their chain (you'd have to spam debug printfs all around you expect this chain to happen to replace the debugger which would waste time). debugger is really powerful if you use it more than superficially.

replies(1): >>45089627 #
1. boredtofears ◴[] No.45089627[source]
> you'd have to spam debug printfs all around you expect this chain to happen to replace the debugger which would waste time

It's not wasting time, it's narrowing in on the things you know you need to look for and hiding everything else. With a debugger you have to do this step mentally every time you look at the debugger output.

replies(1): >>45089669 #
2. shmerl ◴[] No.45089669[source]
Trying to guess what that chain is and putting printf's all around that path feels like doing a poor simulation of what debugger can do out of the box and unlike us - precisely. So I'd say it's exactly the opposite.

If you only care about some specific spot, then sure - printf is enough, but you also need to recompile things every time you add a new one or change debug related details, while debugger can do it re-running things without recompilation. So if anything, printf method can take more time.

Also, in debugger you can reproduce printf using REPL.