8

Through searching I found a question that answers the thing I am looking for, so I have no need to ask the question. But in the answer there is an example, a bit more than asked for. That extra bit is hard to understand, so a new question popped into my head.

Now, that is a new question. Should I open a new question, or should I ask for clarification in a comment?

The answer is accepted and has enough up-votes to consider it correct. My feeling tells me comments are just to improve the question/answer, not yourself. But then again, it would end up being this lame "what does this mean" question that nobody is ever going to find through search; thus it's a bad question.

6
  • 4
    If the question focuses on the code and not the answer, sure, as long as it is a complete question. Would also help to show your research and be as specific as possible.
    – Kevin B
    Jan 22, 2015 at 20:14
  • Also remember to shorten the code as much as possible, showing what you input into it and what you get out of it.
    – Kevin B
    Jan 22, 2015 at 20:21
  • Guess it would also help to extend the question title by not using this but a very small fragment of what happening in the code? eg: "What does i++ mean?"
    – Tim
    Jan 22, 2015 at 20:21
  • Correct, "What does i++ mean?" would be a question that gets views in search results very often. Of course, make sure it isn't a duplicate.
    – Kevin B
    Jan 22, 2015 at 20:23
  • Was just an example, not the real question I'm thinking about. Thanks for the advise.
    – Tim
    Jan 22, 2015 at 20:26
  • 1
    Basically, break the question down to the smallest piece. Asking what 3 lines of code does isn't going to gain much traction, however, asking what an operator does on the other hand will likely be very popular (if it isn't a duplicate)
    – Kevin B
    Jan 22, 2015 at 20:28

2 Answers 2

7

It's perfectly kosher to link to a previous answer in your question. Doing so may make your question easier to answer by providing additional context, so I would encourage it.

Asking in a comment can be reasonable, sometimes, but asking a new question will get you more attention. Assuming the question is otherwise suitable for StackOverflow, it may be easier to find than the comment. That helps searchers in the long run, and in some sense, they're our real target audience.

2
  • 1
    Just beware that asking for an explanation of someone else's code (What does this code do? How does this work?) is generally off-topic. One needs to take ownership of the code (compile it, run some test cases, isolate where the behavior is surprising).
    – Ben Voigt
    Jan 22, 2015 at 22:40
  • 1
    Yes, absolutely. Linking to a previous answer is not an excuse for asking bad questions.
    – Kevin
    Jan 22, 2015 at 23:29
2

I would say that as long as you follow the question-asking guidelines, you will be fine. So if you have a specific question about the example (why does this part of the code do that, why is this working, etc.) go ahead and ask it in a new question and link to the original answer.

If you just have a question like what in the world is going on in this example, it will probably be closed as too broad. In this case, asking for clarification in a comment would be better.

TL;DR It depends on whether the new question would be a good question.

You must log in to answer this question.

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