Live data from Hacker News

Why don't schools teach debugging? (2014)

danluu.com

81–90 of 174 posts

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

#81

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

What kind of middle school did you go to????

[deleted]

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

#82

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 imagine it would be quite hard to come up with good debugging examples for a class.

Here's a high-level idea that might be doable in the right circumstances.

Get one or two hardware guys from an engineering company near the institution to come out with an old version of their silicon that has a fairly rapidly (but not necessarily trivially) triggerable bug. Set the system up, run over how it works, explain the ins and outs of the debug environment/setup, make the bug fire, and spend the next $class_length getting the students to try and figure the bug out.

If the guys can't come back for repeat sessions, they explain it at the end.

I suggest previous-gen silicon in the hope this would decrease the NDA requirement. Then again, even that may not be enough; obviously this would be CPU dependent. But even if the chip was otherwise NDA'd, if it uses a popular (or at least non-NDA'd) core and the bug is in there, that could work too - maybe you could do a partnership type thing with a custom build of the debugger that has NDA'd components hidden.

Maybe you can set up VNC or RDP from student laptops back to the test setup up the front, maybe the students can just backseat-drive. But just describing this, I'm excited, I'd totally want to go to a class like this! (Which was why I tried to think of ways to get around the NDA issue)

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

#84
post #76

Earlier quoted context omitted.

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!

But I can't get them to integrate well with my dev tools. If, for example, I'm using something like babel/webpack/Typescript there is no easy way that I've found to for example just set breakpoint on a line of code in my editor/IDE and have the web browser debugger break when it gets there.

True you probably can't set the breakpoint in your IDE but thanks to source maps you can still view the original source in the debugger.

https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_...

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

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

I almost always start with thinking about where the bug is likely to be, then doing some print/log debugging to confirm or reject my suspicions. I find it pretty effective and simple to do.

Debuggers are complicated and create dependency. How many developers do you see every day just sitting at their computer tapping "step" ... "step" ... "step" for hours.

I'll break out a debugger if all else fails, but it's not my first choice.

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

#86
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!

Please teach unit testing. I'm constantly amazed at how many students can leave school without ever even hearing about this thing called "unit testing." They'll have to look it up when they get home. Those that have heard it, still don't get how to write to in a form that can be unit tested.

The number one criteria we have when hiring a fresh graduate is the quantification of how much time we can devote to training them their first year. Demonstration of unit tests in sample code signals lessened requirements on us. We use it as one of our proxies (a real internship is an example of another.)

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

#87

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.

One of the things that happens here is the more static and optimized a compiler output is, the harder it is to do source level debugging. Conversely, more dynamic, less optimized languages are easier to write and verify debuggers for. This isn't a strict ordering, of course, but a general trend. Unfortunately, the very aspect that make some languages easier to debug make them poor at some of the applications you might want the former for (cf C# and c++ as you bring up).

Luckily debugging is not merely the act of using a debugger !

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

#88
post #8
post #2

Profusely agree with the author. As someone who switched into CS from the humanities, one of the biggest challenges for me was less about syntax and more about figuring out the errors in my logic. For some reason though the former seems to get more focus by professors. "We excitedly explained our newly discovered technique to those around us, walking them through a couple steps. No one had trouble; not even people wh…

as long as you don't copy paste code That's the million dollar question: how do you know whether a classmate is being earnest or just copying you? Especially in highly competitive environments, cheaters are extremely adept at leveraging your work without substantially contributing anything back. The way it works in law school is that students (at least the social ones) break up into study groups early on. They may or…

>That's the million dollar question: how do you know whether a classmate is being earnest or just copying you? Especially in highly competitive environments, cheaters are extremely adept at leveraging your work without substantially contributing anything back.

What if I'm very good at one thing and very bad at another? That would probably work with the study group just fine, assuming they know it and adjust accordingly, but it's still 'cheating' in the sense that I can get away with only a partial understanding.

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

#89
post #76

Earlier quoted context omitted.

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!

But I can't get them to integrate well with my dev tools. If, for example, I'm using something like babel/webpack/Typescript there is no easy way that I've found to for example just set breakpoint on a line of code in my editor/IDE and have the web browser debugger break when it gets there.

Not as convenient, but you can write the statement `debugger;` and the debugger will stop there.

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

#90
for the same reason kids come out of college woefully prepared to build software in the real world.

college is an absolutely horrible environment to learn programming.

programming should have a journeyman apprentice program like electricians.

I learned more from a mentor than I ever did in school.. it honestly was a waste of money.

Post reply on HN