Live data from Hacker News

Why don't schools teach debugging? (2014)

danluu.com

91–100 of 174 posts

Re: Why don't schools teach debugging? (2014)

#91

> the problems were caused by not having an intuitive understanding of, for example, the difference between f(x+a) and f(x)+a Does the author really advocate that the instructor of advanced college course needs to spend his time on explaining the difference between f(x+a) and f(x)+a to his students? I don't have any idea how someone with such an understanding of algebra could even get into a college even if he wanted…

>I don't have any idea how someone with such an understanding of algebra could even get into a college even if he wanted to learn humanities.

Schools' income depends on the number of students (either a budget allocated according to student population, or students paying directly). Therefore, the incentive is to delay failing people as long as possible, as long as it doesn't affect the quality of the graduates.

Re: Why don't schools teach debugging? (2014)

#92

Earlier quoted context omitted.

I just think debugging is art and parcel of programming. Debugging should come up in the first practical exercise in a Graphics 101. It should come up the first time you do an ML assignment in Programming Languages. Its absence in any course is conspicuous. But at the same time more than half of the professional web developers I know don't really use a debugger. Equally problematic.

Is an ML course now a common part of an undergraduate degree program, though? --I genuinely don't know, which is why I'm asking. These days it would certainly be much easier to teach students how to use a debugger - most students probably aren't doing their work on mainframes anymore where resources might be limited (anyone else remember getting emails asking you to release your semaphores because the server is runni…

It was to me, as a "Artificial Intelligence II" optional lectures, in the mid-90's.

I rather focused on compiler design and graphical programming options instead, but I remember that all the basis for neuron learning algorithms were already part of the content.

Re: Why don't schools teach debugging? (2014)

#93
post #13

I have always felt that I was better at debugging than programming :-) I have often been able to debug really complex problems but afterwards I am not able to retrace the steps that I took to come up with the diagnosis - so I'm not sure if this skill can be taught.

I KNOW I'm better at debugging than at programming. My own working code is terribly simple and straightforward but I've fixed kernel sound drivers, buggy firmwares and complex interrupt-driven music players. Perhaps I find it easier to construct a mental model when presented with a finished system rather than when starting from scratch.

> My own working code is terribly simple and straightforward

That makes you a good programmer, too. ;)

Re: Why don't schools teach debugging? (2014)

#94

Earlier quoted context omitted.

Its that way in all the niches, which makes it a set of all niches ==> mainstream thing.

Optimised C++ sure but you don't see this issue with C#. If you are using a high-level language that does not have a reliable debugger, time to change language.

I imagine this situation might surface when looking at optimized native code, either from JIT or AOT, for example via WinDbg sos plugin for .NET.

Still not a reason enough to avoid using a debugger.

Re: Why don't schools teach debugging? (2014)

#95
It is a task that shouldn't be learned in university but in middle school. And it's not just useful to stem, it's useful to many things in life. E.g. a disagreement between two educated, smart people usually can be resolved by debugging how everybody got to their point of view and then flashing out the details. It's also how you figure out why the toaster isn't working any more, or why your wife left you.

It's also actually two skills:

Analysing a state. What do you see, what is there, or isn't. What was expected.

Backtracing. Getting from point y to point x by figuring out how y happened.

I'd say at least in my country we also actually learn these skills. But when we learn the methods its in a completely different context, totally unrelated to life. In real life, you hit a problem, you get overwhelmed by the complexity, and then your brain needs to start applying the method. In school you learn the method, no idea why. Then you apply it to totally theoretical problems, no idea why. Then you get tested on how well you execute the method, no idea why. Then nobody ever talks about it again. Now, how should your brain in moment of being overwhelmed remember that method A it learned 20 years ago may apply here? There's no way.

Teaching shouldn't be: theory->method->application->test. It should be theory->enforce_problem->wait_for_questions->explain_how_theory_can_be_applied->review_of_application->goto:enforce_problem.

Re: Why don't schools teach debugging? (2014)

#96
post #34

> why schools don’t teach systematic debugging. It’s one of the most fundamental skills And herein lies Dan Luu's fundamental misconception: that universities see themselves as places where students come to learn skills , i.e. as places of certification producing skilled workers for industry. Most universities see themselves as academic places of learning for the pursuit of knowledge for knowledge's sake, which only…

> places of certification producing skilled workers for industry

In Portugal that place belongs to Polytechnics.

Universities are to learn to learn.

Re: Why don't schools teach debugging? (2014)

#97
post #95

It is a task that shouldn't be learned in university but in middle school. And it's not just useful to stem, it's useful to many things in life. E.g. a disagreement between two educated, smart people usually can be resolved by debugging how everybody got to their point of view and then flashing out the details. It's also how you figure out why the toaster isn't working any more, or why your wife left you. It's also a…

fantastic pov.. thanks for sharing

Re: Why don't schools teach debugging? (2014)

#98
What schools DON'T teach debugging? Simple trace statements were one of the first things we learned in 101.

Maybe I was just lucky to have a good teacher. I still remember him not liking my solution to a problem when I was extremely proud of how smart I'd made an object, so that it reacted properly based on whatever was passed in. Instead of arguing with me he offered an extra credit assignment to take all of the logic out of the object and see if I could get it working that way...I did it and realized how much simpler his way was.

Hindsight makes you appreciate the patience that took.

Re: Why don't schools teach debugging? (2014)

#99

I imagine it would be quite hard to come up with good debugging examples for a class. Anything that has one right answer is going to smell like a made-up classroom assignment. The thing that makes debugging hard is multiple hypotheses (or amazingly, exhausting all hypotheses). Your crash can be caused by errors on many different abstraction levels, so your debugging process has to be thought about on many levels. On…

> Anything that has one right answer is going to smell like a made-up classroom assignment.

It should be alright in a classroom setting. I remember one particular piece of an assignment that I received a 0 on many years ago.

We were doing String manipulation, and the iterative pieces of the assignment culminated in us building a simplistic cipher. The part I did not receive credit for was recursively reversing the String. I just called the reverse method. Same result, so no harm no foul right? Wrong.

The point wasn't to reverse the String so that the cipher could be created. It was to incorporate programming basics such as recursion into an assignment. It was a shoe-horned method to get us to use recursion, but it got the point across.

Re: Why don't schools teach debugging? (2014)

#100
post #95

It is a task that shouldn't be learned in university but in middle school. And it's not just useful to stem, it's useful to many things in life. E.g. a disagreement between two educated, smart people usually can be resolved by debugging how everybody got to their point of view and then flashing out the details. It's also how you figure out why the toaster isn't working any more, or why your wife left you. It's also a…

Agree in principle. Another way of putting it is, debugging is another word for applying the "scientific method." E.g., experimental vs control group is a useful concept in debugging
Post reply on HN