Hacker News new | ask | show | jobs
by omosubi 233 days ago
I would add debugging as a course. Maybe they should teach this but how to dive deep into figuring out how to learn the root cause of defects and various tools would have been enormously helpful for me. Perhaps this already exists
6 comments

Great idea. I had a chemistry lab in college where I was given a vial of a white powder on the first day of class and the course was complete when I identified what it was.

A similar course in CS would give each student a legacy codebase with a few dozen bugs and performance / scaling problems. When the code passes all unit and integration tests, the course is complete.

Along with a course on how to read other people's code and how to resist the urge to tear down Chesterton's fence while you fix bugs
I feel like that's something you pick from solving problems. You hit something, printf and check work, repeat.

Repwat for 2 yeaes. Rhen later on, my Systems Programming course would give an overview of GDB, Valgrind, and tease the class with GProf. It'd even warn us on the dangers of debugging hypnosis. But that was all the extent of formal debugging I got. The rest was on the job or during projects.

System programming courses force people to debug seriously. Sometimes people can't printf() stuffs.
Yes please. Even senior engineers apply with their debugging abilities limited to sprinkling print-exit over the code.

Do you have a moment to talk about our saviour, Lord interactive debugging?

Interactive debugging tends to be unhelpful on anything realtime. By the time you look at what's going on, all the timing constraints are shot and everything is broken. You may be able to see the current state of that thread at that moment, but you can't move forward from there. (Unless you freeze all the threads - but then, all the threads involved might not be in one process, or even on one machine.)
Sometimes logs are the only way.

It's old but reliable.

I’m not negating that. But in most cases, using a debugger is the vastly superior way to debug issues, yet many developers have never bothered to pick up on that knowledge. Like a carpenter that hasn’t ever learned to work with power tools and insists to use manual screwdrivers for everything.