Live data from Hacker News

Why don't schools teach debugging? (2014)

danluu.com

111–120 of 174 posts

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

#111
I went to university when few people had their own PC. It's true there was no catalog class in debugging but we all got very good instruction and learned many techniques in the lab, especially from the lab TAs. I would suggest the author seek out where the comp sci students congregate these days and talk through issues there.

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

#112
I haven't seen anyone mention the following yet, and it's INCREDIBLY important!

When something is not working right and you have to debug it, you need to re-evaluate your abstractions and drop down a level in your technology stack.

In Dan's case, he had to look at, and think about how the logic gates worked.

In a more modern case, when your REST calls aren't working right, you may have to debug HTTPS stuff.

If your HTTPS stuff isn't working you may have to look at key negotiation and exchange, etc etc.

If your Entity Framework isn't working, you may have to (horrors!) look at what's going on with the database.

If the database isn't working, you may have to (gasp!) look at the hardware it's running on.

Too often people look at surrounding code or state, and do not verify the abstractions of lower-level code or hardware. Those things have "always worked" - it's never the compiler's fault, until it is (or a bad assumption of how the compiler works)

I've seen people here talk about iterating, which is fine and good for many problems. For many debugging problems iterating will take you until the heat death of the universe to solve.

I don't really think "fullstack" devs are always the best solution, or a scale-able approach to development; but a fullstack dev with a debugging background is hard to beat when you have problems.

Edit: To put it another way: If your technology isn't working, you have to examine the engineering under it. If the engineering isn't working, you have to examine the science. If the science isn't working, you have bad assumptions, or you've found new science! (you probably have bad assumptions)

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

#113
post #104

Earlier quoted context omitted.

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.

Then I bieleve the argument still stands. Universities would teach knowledge better if they spent a comparatively tiny amount of time teaching appropriate skills, as it would get students ready to learn.

The author demonstrated this point by showing how his classes could help students learn better.

We can then debate about whether having successful students is a positive thing to have for universities, but Dan Luu clearly seems to think it is.

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

#114
When I was in school I showed my algorithm(on paper) to my teacher and He said: "It's wrong". I strongly said: "It works!". He froze for few seconds and than said: "Use these data for inputs" and I immediately saw the bug. Of course the entire class laughed.

I know that The story isn't about debugging, but sometimes showing "right" inputs can be very efficient way how to explain the bug to other person.

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

#115

Earlier quoted context omitted.

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.

Sure. But getting the spec right is more important than being smug about a silly mistake only novices make. And C has much more interesting caveats than this one.

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

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

see also this: https://news.ycombinator.com/item?id=8280379

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

#117

When I was in school I showed my algorithm(on paper) to my teacher and He said: "It's wrong". I strongly said: "It works!". He froze for few seconds and than said: "Use these data for inputs" and I immediately saw the bug. Of course the entire class laughed. I know that The story isn't about debugging, but sometimes showing "right" inputs can be very efficient way how to explain the bug to other person.

"froze" implied he was scared. try "paused" or "ruminated" instead.

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

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

I hope your employer values you. Good debuggers (persons) seems to be rare. Esp people who also like to debug stuff. And you are soo needed.

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

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

An important part of analyzing state, and specifically a mismatch between the state and your expectations, is to ask yourself whether your expectations are valid. Not every bug is an error in coding what you intended, and we naturally tend to be somewhat blind to our own incorrect assumptions.

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

#120
Beyond a few simple techniques (printing values, writing and examining logs, practicing the scientific method) and defensive strategies (asserts, writing good tests, parameter checking, etc.) debugging gets environment-specific pretty quickly. Gronking through a bug in an embedded system is way different from figuring out why your rack of servers has gone dark, though the root cause might be the same.

I've found the best way to learn debugging is to should-surf someone who is good at debugging. For instance, I'd spent six months at Apple before I watched a resident wizard for an hour in the low-level debugger, and what I learned in that hour improved my skills dramatically. Repeat for two other companies: Encounter a tough problem (for you), find a wizard to help out, and pay attention.

I think the sentiment in schools is that sufficiently challenging coursework will force you to learn debugging techniques on your own, as a natural outcome of you writing code :-)

Post reply on HN