5

In answering questions, sometimes the new users don't know how to do simple debugging. I was thinking of creating a resource which would provide information on how to do that here on Stack Overflow.

I was thinking I would ask a question such as "How do I debug my Java code?" and answer it myself. Plus, if another person gives a better answer, I could accept theirs instead.

I did find a similar question How can I debug my code?

However, it is tagged with - and I would like to provide multiple IDE examples.

I suppose really my questions are the following:

  1. In general, should I ask a question I know the answer too if I think it will be useful to others? Is there a more useful way to post something like this, here on Stack Overflow?
  2. In this case, should I ask the question? Or, should I add it to the existing question even though all of it doesn't apply to that question?

The question that this question is marked a duplicate of is asking about a user who is seeking additional answers to the one he already has.

If it is to be considered a duplicate, I think my question is more valuable to the site since it has better quality and more direct answers. According to Here the other question should be closed instead, in my opinion.

1

3 Answers 3

6

Yes, of course you can; from the help center:

https://stackoverflow.com/help/self-answer

And the most famous example of this:

What is a NullReferenceException, and how do I fix it?

Just make sure both the question and answer are up to the quality standards of SO and you'll be fine. "How do I debug my code in < insert IDE >" could easily make a good canonical question (though it smells a bit broad).

2
1

In this specific instance, "How do I debug my Java code?" and "I would like to provide multiple IDE examples" suggest that such a question would likely be closed as "too broad".

1

There is nothing wrong with a self-answer, however, canonical/FAQ questions such as these:

...have a narrow, specific scope to their domain/tool. To quote Andrew Medico:

In this specific instance, "How do I debug my Java code?" and "I would like to provide multiple IDE examples" suggest that such a question would likely be closed as "too broad".

StackOverflow is meant to be a repository of detailed answers to specific questions and not be customer support for "[a user's] favorite company". If there is a common issue related to debugging and related to that you feel can make a good canonical question, then by all means, post it. However, I wouldn't recommend adding a new answer to the question you linked as it seems to be asking "How do I debug in Netbeans?" and that is what the documentation is for.

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