Live data from Hacker News

Why don't schools teach debugging? (2014)

danluu.com

101–110 of 174 posts

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

#101

Earlier quoted context omitted.

> Anything that has one right answer is going to smell like a made-up classroom assignment. If you're doing C (or any other language where that particular problem exists), it's always a nice exercise to have students write a program (or a function) that takes the radius of a circle and outputs its volume. Most students will write: double volume(double radius) { return 4 / 3 * M_PI * radius * radius * radius; } Can yo…

Circle has no volume

Although I laughed, I'm sure GP meant sphere. That is the correct formula for volume of a sphere, and a sphere is a circle in 3-space.

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

#102
Back when I was in college I had a bit of reputation as a "hacker" and one of my friends wanted my help at stealing somebody else's homework for CS101.

Turned out the program we stole didn't quite work and the process of debugging it was at least as educational as starting from scratch.

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

#103
The more egregious thing schools don't teach is working in large existing codebases, i.e., the skill of reading and figuring out code.

Instead they focus on /writing/ code. In the process of writing code, at least some incidental debugging experience is gained (this article is actually an example of that -- the debugging wasn't formally taught, but the assignment clearly forced the author to learn it a bit), but almost no /reading/ code experience. It took me a while in industry to make up for this deficit.

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

#104
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…

I respectfully disagree with your argument in relation to this article. Dan Luu is describing a method that would help people achieve a better success in their exams and classes, he's not even pointing their usefulness in the workplace. Therefore, your point about him thinking that universities are here to produce skilled workers is a strawman.

His point is that university is here to produce/teach knowledge. Skills should be learned elsewhere, e.g. in schools prior to that. The university's official language is also a skill that is very important to the student's success, but the university is not responsible to teach this language skill. You must have it to enter university.

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

#105

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 log…

It's the first time I hear that anybody got taught debugging, honestly.

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

#106
> Why do we leave material out of classes and then fail students who can’t figure out that material for themselves? Why do we make the first couple years of an engineering major some kind of hazing ritual, instead of simply teaching people what they need to know to be good engineers?

Yeah, this is horrible and irresponsible on the university and professors' part. But that's the way it seems to be in most large US universities (anecdotally based on talking to friends in grad schools).

However, decent small liberal arts colleges often do exactly what you prescribe, they correctly try to teach it to everyone and generally succeed. Big box schools are just exploiting undergrads as cash cows, don't attend them or send your children to them.

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

#107

When asked "How do you debug programs?" my Programming Languages professor responded, "I don't. I prove every line correct before I write it."

Good, now do that on a deadline, with python.

Yep. Try that in the business world and your competitor will iterate five times while you're still working on your prototype, and your milkshake will have been drunk, digested, and excreted.

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

#109
Fantastic essay, and I think the same teaching could be applied to so many other skills needed to succeed as well. When people talk about academia as an ivory tower, this is exactly what they mean. Academia seems to be utterly focused on "cool ideas" and "intellectual exploration", and they really short-change the nitty-gritty skills that may not be as intellectually stimulating, but are still absolutely needed to get stuff done.

To give another example, anyone who's working in a programming context can boost their productivity by knowing how to set up their aliases, learning the basics of unix tools such as grep, and mastering a good text-editor/IDE such as vim/emacs/intellij. And yet, after 4 years in college, I didn't know a single thing about any of the above, and slowly picked up bits and pieces randomly over the course of my career. If a professor could have taught the above in a intro-to-engineering course, it would have saved us countless hours and allowed us to hit the ground running.

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

#110

I think the Feynman Method is equally applicable to debugging; I've also done some teaching before, and seen far too many beginners open the debugger at the first bug they find and start stepping aimlessly through the code, seemingly unaware of what their code should be doing. They eventually reach the point where the program outputs the wrong result, and have no better understanding of what they did wrong, because t…

I've heard of top-down and bottom-up design, and what you're describing sounds like top-down debugging, in contrast to "open the debugger at the first bug" -- bottom-up debugging?

They're both great, like having two sets of teeth to grind problems down to a fine digestible paste.

My software engineering prof encouraged us to use both approaches to programming. The analogy to teeth, however, is my own.

Post reply on HN