Live data from Hacker News

Why don't schools teach debugging? (2014)

danluu.com

61–70 of 174 posts

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

#61
post #32
post #14

Earlier quoted context omitted.

But at the same time more than half of the professional web developers I know don't really use a debugger. Equally problematic. I wonder how much that has to do with tooling? When programming in python I run everything in a debugger basically all the time. When doing JavaScript front-end work it's back to print debugging.

In many ways, the tooling around web development is far superior to other languages (e.g. golang with delve). Most browsers ship with excellent debug tools. The caveat obviously being that debugging code written using some JS frameworks, like Polymer, is a nightmare.

and in many ways the tooling around web development is absolutely terrible (eg not a brand new language eg go but an established language eg any of them)

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

#62
post #11

At UC Berkeley, we are planning a lab devoted to practical debugging for next year's Data Structures course. Your ideas/suggestions are appreciated!

There are many methods of debugging as you can see sprinkled through these comments:

Using the interactive debugger Reading log files and adding more logging/trace. Writing unit tests Making some sort of test program or script to exercise the problem area so it's easier to reproduce the problem. Depending on your environment, tools and problem, different combinations of the above will make more sense.

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

#63
post #14

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.

But at the same time more than half of the professional web developers I know don't really use a debugger. Equally problematic. I wonder how much that has to do with tooling? When programming in python I run everything in a debugger basically all the time. When doing JavaScript front-end work it's back to print debugging.

Which is so odd to me because the JavaScript debug tools are some of the most complete and easiest to use. They're right there!

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

#64
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.

Neal Stephenson writes about this in my favorite "the diamond age," he calls it honer and forger. The type of engineer that is better at improving an existing thing vs. creating something new.

There's a need for all types.

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

#65
I wonder why whenever such a discussion pops up, almost nobody mentions the stacktrace. I've seen so many CS students, who fail at reading that first representation of a problem, I really wonder why that is.

Also I like debugging via print much better than with a debugger, because it's easier for me to spot the problem. Breakpoints are great though.

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

#66

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…

I think the problem is more general than debugging and is really just about troubleshooting in general.

How do you abstract away a problem so you can individually identify and isolate the parts and test them individually? The same general techniques apply whether you're debugging a c program or repairing a car.

Just on the basis of interacting with coworkers, when I see people fumbling around in the dark, it's usually just because they're not using basic troubleshooting, they're just googling (at best!) and trying random fixes in a scattershot approach.

Quite a few times, I've helped people who were far more knowledgeable than me about, for example, Linux, by just asking them questions and trying different experiments to see if we could eliminate possibilities and so on. At the end of it, the problem is fixed and they thank me for the help, even though they knew everything they needed to know to fix the problem to begin with.

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

#67

I wonder why whenever such a discussion pops up, almost nobody mentions the stacktrace. I've seen so many CS students, who fail at reading that first representation of a problem, I really wonder why that is. Also I like debugging via print much better than with a debugger, because it's easier for me to spot the problem. Breakpoints are great though.

That's not quite the sort or debugging being discussed here though - they're talking general theory of how to think through a problem to locate the issue, which applies to more things than just software including computer hardware, cars, circuit boards, just about any large system really - you do common things like replacing or disabling parts of the system, probing values at certain points, logging values, etc. For the most part, these things have a lot in common, but few people know how to approach such problems.

It's interesting that I see them saying "the more talented the engineer, the more likely they are to hit a debugging wall outside of school". I was only ever a good engineer in school because I was able to debug. You don't understand something til you tear it apart.

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

#68
post #25
post #4

This can really be extended to basic troubleshooting skills, and goes beyond software development -- beyond technology, even. Troubleshooting is really just a special application of general 'problem solving', which is something schools aim to teach. I'm not sure why troubleshooting skills are not taught, especially something like "divide and conquer" [1]. Even in very complex systems, so long as you have the right ac…

I wanted to write something similar, so I just upvoted you and piggybacked here. "Debugging" is really a subset of "Problem Solving". My grandfather had (by today's standards) very poor schooling, but he taught me some PHYSICAL WORLD DEBUGGING techniques which proved useful later in life. Just one simple example (I suppose this would be "Tracing" in IT) - once he was working on a cabinet that had somehow warped and w…

Yep, my dad was a mechanic when he was younger and worked on cars for fun, and he taught me troubleshooting before we even had a computer.

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

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

Debugging is useful even from a merely academic perspective if engineering is an academic discipline (I think it is). Reality pushes up against you, so you figure out what it's doing by looking at what happens and guessing at what might have caused it. You aren't circumscribed by your model (as you are in a purely mathematical simplification; consider the inutility of Navier-Stokes for many engineering applications) when the 'bug' is smacking you in the face. This isn't just Popperian falsifiability; it's also just (more fundamentally) abduction.

The article doesn't press this point very hard, but I take the central argument to be in favor of 'systematically approach[ing] problems [of the sort that debugging instantiates]' which is just as much 'academy' as 'industry'.

Post reply on HN