26

So this question got closed then got re-opened, but no answer was given, because there is no good answer for this question. The asker needs some basic debugging help.

Now in the tag I see this regularly. I commented a few times suggesting to put a breakpoint and examine the state of variables, but I never once got any reply to that. I'm not sure why, but maybe that's because the asker has no idea what I'm talking about?

So my question is, can we help such people? Do we have a canonical answer, or a help entry that explains a novice how to debug (in Visual Studio, or elsewhere)? Or is it out of scope of Stack Overflow?

11
  • 5
    With the new Documentation feature we will have that. Otherwise there are canonical questions for many common problems. As far as I know there isn't a "How to debug code" general reference question, not that it would be useful if there was.
    – user4639281
    Dec 31, 2015 at 0:54
  • 1
    @TinyGiant, why do you think it would not be useful? (Not disagreeing, just would like to understand) Dec 31, 2015 at 0:55
  • 2
    Because it would be overly broad for the Q&A format, you wouldn't be able to find any useful information specific to one problem.
    – user4639281
    Dec 31, 2015 at 0:57
  • 1
    I certainly think a canonical question for "How to debug JavaScript using Chrome devtools" would be useful. That exact thought has occurred to me more than once. I've commented that the user should debug his or her program using devtools (or examine CSS styles, etc.) a number of times, with the answer being "I didn't know about that".
    – user663031
    Dec 31, 2015 at 3:05
  • 1
    Eric Lippert wrote a very useful guide on How to debug small programs. But since this does seem to fall squarely in "tutorial" territory, I'd say it's currently out of scope for SO. Dec 31, 2015 at 7:06
  • I tried to answer such a question once by showing how to do simple debugging with print statements to see the flow through nested for-loops. The end result? A downvoted poor question with an upvoted answer, and the OP took the explanation and ran for it. I've been on the fence about what to do with that ever since, my gut says delete the answer so the question can be auto-pruned.
    – Gimby
    Dec 31, 2015 at 8:42
  • 1
    @torazaburo: Will you detail the usage of every feature of Chrome dev tools? What about Firebug? Microsoft Edge console tool? IE10 Developer tools? Opera Dragonfly? That's starting to sound quite broad indeed.
    – user4639281
    Dec 31, 2015 at 9:17
  • I have commented on several questions recommending that they read [mcve] and specially Eric Lippert's article linked at the end of [mcve].
    – AdrianHHH
    Dec 31, 2015 at 13:38
  • @TinyGiant Sure, there are issues of scope. Basically, I would like a question to use as a duplicate for closing such issues, if that's within the realm of the reasonable.
    – user663031
    Dec 31, 2015 at 14:05
  • @torazaburo As I said in my first comment here: "With the new Documentation feature we will have that." With the Q&A system, it would just be to difficult to organize it in such a way that relevant information can be easily found and accessed. IIRC it was said that questions will be able to be closed as duplicates of documentation pages if the documentation pages answers the question. Even if that doesn't happen though, you could just point them to the relevant documentation and close the question for whatever other reason applies, or downvote and move on if there is no other close reason.
    – user4639281
    Dec 31, 2015 at 19:40
  • This idea has been suggested before. I was positive about it but the question got finally closed and deleted.
    – 5gon12eder
    Jan 2, 2016 at 23:44

1 Answer 1

5

An appropriate place for links to tools for or tutorials about debugging would be in the tag wiki.

You can then direct people to that link by appending 'info' to the tag URL, e.g. https://stackoverflow.com/tags/c%23/info.

If there is a single good tutorial link you can think of (for example for MATLAB there's http://uk.mathworks.com/help/matlab/debugging-code.html), comment with that instead.

Either way, it is then appropriate to close as off-topic where the issue is that the OP either hasn't done any debugging or doesn't appear to know how.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .