Why is debugging better in an IDE?
I've been a software developer for over twenty years, programming in C, Perl, SQL, Java, PHP, JavaScript, and recently Python. I've never had a problem I could not debug using some careful thought, and well-placed debugging print
statements.
I respect that many people say that my techniques are primitive, and using a real debugger in an IDE is much better. Yet from my observation, IDE users don't appear to debug faster or more successfully than I can, using my stone knives and bear skins. I'm sincerely open to learning the right tools, I've just never been shown a compelling advantage to using visual debuggers.
Moreover, I have never read a tutorial or book that showed how to debug effectively using an IDE, beyond the basics of how to set breakpoints and display the contents of variables.
What am I missing? What makes IDE debugging tools so much more effective than thoughtful use of diagnostic print
statements?
Can you suggest resources (tutorials, books, screencasts) that show the finer techniques of IDE debugging?
Sweet answers! Thanks much to everyone for taking the time. Very illuminating. I voted up many, and voted none down.
Some notable points:
Some examples of some abilities that an IDE debugger will give you over trace messages in code:
In summary, print statements are (generally) static and you'll need to re-compile to get additional information if your original statements weren't detailed enough. The IDE removes this static barrier, giving you a dynamic toolkit at your fingertips.
When I first started coding, I couldn't understand what the big deal with debuggers was and I thought I could achieve anything with tracing (granted, that was on unix and the debugger was GDB). But once you learn how to properly use a graphical debugger, you don't want to go back to print statements.
An IDE debugger lets you change the values of variables at run-time.
An IDE debugger lets you see the value of variables you didn't know you wanted to see when execution began.
An IDE debugger lets you see the call stack and examine the state of the function passed weird values. (think this function is called from hundreds of places, you don't know where these weird values are coming from)
An IDE debugger lets you conditionally break execution at any point in code, based on a condition, not a line number.
An IDE debugger will let you examine the state of the program in the case of an unhandled exception instead of just crapping out.
这里有一件事你绝对不能用“打印”语句进行调试,这是当客户给你带来内存转储并且说“你的程序崩溃了,你能告诉我为什么吗?”
链接地址: http://www.djcxy.com/p/36060.html上一篇: 你如何从MSIL调用私有方法?
下一篇: 为什么在IDE中调试更好?