4 ms·
Probably the most interesting thing about development as a discipline is the near radio silence on how to debug. There is a decided lack of academic success in
by roenxi 6y ago
Probably the most interesting thing about development as a discipline is the near radio silence on how to debug.
There is a decided lack of academic success in engaging with debugging as an object that can be studied. There are channels to learn about debugging as a stand-alone topic. Programmers don't often talk about debugging techniques in my experience.
For something that takes up the overwhelming bulk of a developer's time the silence is in many ways deafening. It may be that nobody has a method superior to print debugging.
- damagednoob 6y agoI mean there are other types of debuggers (step-through, time travel[1]) but I agree with you that I have never seen any research on which is better/faster. It seems an obvious topic so it makes me suspect that it comes down to individual style. [1] https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/time-travel-debugging-overview https://docs.microsoft.com/en-us/windows-hardware/drivers/de...
- spaetzleesser 6y ago“ which is better/faster” Because the answer is “it depends”. As you mentioned it’s a lot about individual style and preference. I have seen a lot of good coders that got things done but worked in totally different ways.
- Swizec 6y agoDebugging is impossibly difficult to teach. It's much closer to "how to solve an escape room" than it is to "how to build X". Debugging requires deep understanding what you are doing and your system. It's different every time. And while there's a general algorithm you can follow: 1. Guess what's wrong 2. Ask "How would I prove that's wrong?" 3. Try it 4. If bug found, fix, if not go back to 1 How would you teach that other than asking people to go solve a bunch of real world problems in real world systems for a few years?
- slibhb 6y ago> 1. Guess what's wrong 2. Ask "How would I prove that's wrong?" 3. Try it 4. If bug found, fix, if not go back to 1 I think this is exactly right. Teaching 1 is impossible I guess but the general method (it's basically the scientific method in an ideal environment) seems teachable. Come up with a hypothesis of what's wrong, try to prove or disprove the hypothesis.
- lainga 6y agoI might suggest a few of the adventures of Sherlock Holmes.
- prewett 6y agoSo, having conveniently written a monograph on the exact topic that provides extra information, the extraordinary ability to know exactly which minor features of the situation are contradictory, and access to knowledge unavailable to the reader?
- colonwqbang 6y agoFor a system of moderate complexity, there are myriad answers to question (1). A skilled programmer has the intuition to guess the most likely causes. This ranges from the mundane (e.g. recompile everything from scratch) to the occasional almost magical lucky guess which immediately leads to a solution.
- Fronzie 6y agoThe one beginners often miss: What output do you expect? Ask this yourself before starting the debugger. Without this, it is very easy to glance over the point where things go funny.
- anaerobicover 6y agoThis doesn't seem to be a different problem in kind than teaching people to write programs. How do we do that other than teaching them some mechanics (syntax, how to run the compiler) and then setting them a lot of exercises to gain experience? The same seems to apply to debugging. A student needs to be introduced to the basic concepts and commands, and then practice. Just same as with a writing exercise, the instructor can have specific problems to practice specific techniques.
- imagica 6y agoIt's one of those things that is acquired with experience and from more and more peers one has had. I think I've learned a bit from all my peers, almost everyone had something interesting or an interesting way to tackle a problem. Once a lot of time is spent in the industry one starts seeing patterns as a new cycle starts. As far as teaching debugging, it is one thing to show some examples and another one is to run into a bug yourself and get from having no idea how to debug to actually fixing it. That whole experience is hard to replicate in unnatural ways.. When I was in school they told me not to worry too much about debugging and that I'd run into issues in the real world and figure out ways to debug depending on the system and that turned out to be quite correct.
- thenoblesunfish 6y agoIt‘s a very interesting point. I suspect it‘s hard to study because it‘s a very high level capability of our brains. If you understand how we debug, you understand a lot about how reasoning itself works. I did read a book on debugging as a general practice once, but it wasn‘t helpful, as it was mostly anecdotes and generalities.
- geocar 6y ago> For something that takes up the overwhelming bulk of a developer's time... It isn't the bulk of my time. Most of my time is spent figuring out what to do. Once I have decided that, telling the computer is usually straightforward. > Programmers don't often talk about debugging techniques in my experience. No they don't, but look at it this way: Bugs are mistakes, and nobody wants to be told they're making too many mistakes. Anyone who discovers some amazing debugging technique will struggle to share it with anyone else for a lot of reasons, and this is one. > It may be that nobody has a method superior to print debugging. Print debugging always works. Getting "a debugger" to work isn't always easy, and if you aren't already comfortable using the debugger to track down the kind of bug you're facing, you will find it very difficult to find the bug and cure it faster than with print debugging. And since people don't tend to make the same mistakes over and over again, debuggers tend to have a very limited utility in those few mistakes made frequently. My experience is that mistakes like that are the fault of some kind of fundamental misunderstanding, and rather than spend time to learn all of the different fundamental misunderstandings that the debugger was designed to work around, time is better spent simply correcting your misunderstandings.