为什么不教导学生使用调试器? [英] Why aren't students taught to use a debugger?

查看:67
本文介绍了为什么不教导学生使用调试器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SO上有很多家庭作业问题。



我想90%+可以通过逐步解决代码来解决在调试器中,并观察程序/变量状态。



我从没被教过要使用调试器。我只是打印并阅读了GDB手册,并逐步介绍了它们的示例。第一次使用Visual Studio时,我想起了,哇!这可以简化多少,单击以设置断点,将鼠标悬停在该值的变量上,按一个键以进行步进,立即窗口,debug.print等...



无论如何,学生是否被教导使用调试器?如果没有,为什么不呢? (也许更好的问题是,为什么他们不能自己学习使用调试器……也许他们需要被告知有这样的工具可以帮助他们...)



学会使用调试器需要多长时间?

解决方案

我认为问题不在教学中。使用现代的图形调试器并不是火箭科学(至少对于在一台计算机上运行的大多数用户模式程序而言不是)。问题在于某些人的态度。为了有效地使用调试器,您应该:




  • 承认这是您的错 select 没有损坏

  • 有毅力可以花几口钱晚上调试,不会忘记上一点。

  • 没有具体的算法可遵循。您应该根据自己的见识进行有根据的猜测,并根据自己的见识有效地进行推理。在大学里,我看到许多朋友在相对​​较短的时间后放弃,给我带来了一些代码,并告诉我计算机做错了什么。我通常会告诉他们,我比他们更信任自己的计算机(这会伤害某些感觉,但事实就是这样)。


    There's a lot of homework questions here on SO.

    I would guess that 90%+ can be solved by stepping through the code in a debugger, and observing program/variable state.

    I was never taught to use a debugger. I simply printed and read the GDB manual and stepped through their examples. When I used Visual Studio for the first time, I remembered thinking, Wow! how much simpler can this be, click to set a breakpoint, mouse over a variable for the value, press a key to step, the immediate window, debug.print, etc...

    At any rate, are students "taught" to use a debugger? If not, why not? (Perhaps a better question is, why can't they learn to use a debugger themselves... maybe they need to be told that there is such a tool that can help them...)

    How long does it take to learn to use a debugger?

    解决方案

    I don't think the problem is teaching. Using a modern graphical debugger is not rocket science (at least not for most user-mode programs running on a single computer). The problem is with the attitudes of some people. In order to use a debugger effectively, you should:

    • Admit it's your fault and select isn't broken.
    • Have the perseverance to spend a couple nights debugging, without forgetting the previous point.
    • There's no specific algorithm to follow. You should guess educatedly and reason effectively from what you see.

    Not many non-programmers have these attitudes. At college, I have seen many friends who give up after a relatively short period of time and bring me some code and tell me the computer is doing something wrong. I usually tell them I trust their computer more than them (and this hurts some feelings, but that's the way it is).

    这篇关于为什么不教导学生使用调试器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆