2 ms·
> What I tell others: I'm so good that I don't need a debugger. That sounds better than what I tell others, that I'm not smart enough to use a debugger. Debug
by anamax 16y ago
> What I tell others: I'm so good that I don't need a debugger.
That sounds better than what I tell others, that I'm not smart enough to use a debugger.
Debuggers let me get away with code that is on the edge of my understanding at the time that I'm writing it. The problem is that I'm not nearly as smart when I have to revisit that same code later.
In addition, debugging with print requires more understanding, so it's more likely to be correct than debugging with a debugger.
That said, I really liked my time in visual studio.
- vilya 16y ago"In addition, debugging with print requires more understanding, so it's more likely to be correct than debugging with a debugger." I don't believe this is true. I suspect the way most people use print statements for debugging goes something like: "I think the problem is somewhere in this function, let's stick a print statement here. Oops, that doesn't seem to be it, let's try one here. Oops, that's not it either, let's try printing out a different variable." and so on. That's remarkably similar to using a debugger only a lot less efficient, because you have to go back through the whole edit-compile-run cycle each time (or maybe edit-deploy-run if you're working on a web app using a scripting language).
- anamax 16y ago> I don't believe this is true. I suspect the way most people use print statements for debugging goes something like: "I think the problem is somewhere in this function, let's stick a print statement here. Oops, that doesn't seem to be it, let's try one here. Oops, that's not it either, let's try printing out a different variable." and so on. What is the basis for your suspicion? I ask because the folks who I see using print as their first-choice for debugging don't work that way. The overhead associated with changes (as opposed to restarting) gives them the opportunity to think (or grab a new cup of tea). That said, that "poke around randomly" approach does seem to be "not rare" for folks who are "debugger first", as you yourself say. To be fair, the folks I know who are most effective with a debugger also put in some time on understanding before they fire it up.