(no title)
lpapez | 6 months ago
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...
lordnacho|6 months ago
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.
shmerl|6 months ago
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.
ambicapter|6 months ago
What do you mean by this? Do you mean using a logging framework instead of printf()?
cbanek|6 months ago
evertedsphere|6 months ago
https://rustc-dev-guide.rust-lang.org/tracing.html#i-dont-wa...
VectorLock|6 months ago
jennyholzer|6 months ago
marssaxman|6 months ago
TheRoque|6 months ago
Properly debugging my stack is probably one of the first things I setup because I find it way less tedious. Like, for example, if you have an issue in a huge Object or Array, will you actually print all the content, paste it somewhere else and search through the logs ? And by the way, most debuggers also have ability to setup a log points anyways, without having to restart your program. Genuinely curious to know how writing extra lines and having to restart makes things easier.
Of course I'm not saying that I never débug with logs, sometimes it's require or even more efficient, but it's often my second choice.
globular-toast|6 months ago
jacquesm|6 months ago
Interactive debuggers are a great way to waste a ton of time and get absolutely nowhere. They do have their uses but those are not all that common. The biggest usecase for me for GDB has been to inspect stacktraces, having a good mental model of the software you are working on is usually enough to tell you exactly what went wrong if you know where it went wrong.
Lots of people spend way too much time debugging code instead of thinking about it before writing.
Oh, and testing >> debugging.
another_twist|6 months ago
As for tooling, I really love AI coding. My workflow is pasting interfaces in ChatGPT and then just copy pasting stuff back. I usually write the glue code by hand. I also define the test cases and have AI take over those laborious bits. I love solving problems and I genuinely hate typing :)
Gigachad|6 months ago
gdubs|6 months ago
davemp|6 months ago
quantiq|6 months ago
jennyholzer|6 months ago
unconed|6 months ago
Printf gives you an entire trace or log you can glance at, giving you a bird's eye view of entire processes.
oblio|6 months ago