16

I recently asked a Jquery question on Stack Overflow which generated no comments or answers but after a few days of chasing the bug I moved the troubled block of code within the scope of another Jquery section and now it works properly. But, the fix is a behavior I didn't expect and I don't know why it is working so "answer my own question" isn't really appropriate because I can't explain why the resolution works.

Having stated that here is my question: If a poster fixes functionality for the code they have asked a question about before other users submit answers or suggestions through comments, but does not understand the why/how what is the appropriate action to take toward the question?

Vote to close the question? Delete the question?

Add a comment that is resolved and how, but leave question open for someone to possibly explain why the resolution worked?

Or lastly, just leave the question as is and move on?

8
  • 4
    Just update the question with what you discovered. A bounty is a good way to get an answer. Sep 3, 2015 at 19:06
  • @HansPassant That would be putting the answer in the question- DMSJax is saying they solved the problem themselves, they just don't know why what they did solved the problem.
    – Kendra
    Sep 3, 2015 at 19:08
  • 6
    A random change having an effect without knowing why is not an answer. It however can be very helpful for somebody to arrive at the proper answer. Sep 3, 2015 at 19:10
  • If I'm correct on which question they're talking about, it wasn't exactly a "random change" but something they had actually explicitly mentioned not having tried in the question itself, leading me to believe DMSJax actually considered it a potential option, but didn't see why it would change how the code was working. (I actually myself have an idea why it may have worked should I be right on which question it is, but I'd have to do a little more research myself first.)
    – Kendra
    Sep 3, 2015 at 19:14
  • Yeah, that's the question I had assumed it was. I have an idea as to what you did and why it worked, but I'll have to look into it a little more before I could post an answer for you. :)
    – Kendra
    Sep 3, 2015 at 19:20
  • @Kendra it's all good, nothing but time now, I just didn't want to provide a poor quality answer that really didn't give a benefit to a reader.
    – DMSJax
    Sep 3, 2015 at 19:21
  • If it tells the reader how to fix the problem, they're at least better off than where they started. They may not understand why, but they at least know how to fix it.
    – Kendra
    Sep 3, 2015 at 19:26

1 Answer 1

19

What you really need to ask yourself is "Will other people likely stumble upon this issue in their code and find my question helpful?" If the answer is yes, then there's no need to delete your question.

Instead, you should post what you did as an answer. You may not be able to explain why this solution worked, but you can at least verify that it did. I suggest you refrain from saying as much in your answer, however, though you could ask for an explanation if anyone has one in the comments, I would think. Keep it to the facts. As a very basic example:

I found the fix to my issue was X:

code example showing the fix

It's a rather small answer, but it can still help others who encounter the same issue down the line. Be sure to explain what "X" was in words, rather than just dumping code and saying "Well, this worked" in your answer. While that would be an answer to the question, it'll be a more helpful answer if you explain to the best of your abilities what you changed, even if you can't explain why.

In the future, someone who does understand why the code worked one way but not the other may either comment on your answer to explain it to you (and therefore allow you to update your answer with the explanation) or write their own answer with an explanation of why this worked. If this happens, you can then decide to accept their answer, whether you had previously accepted your own or not.

Keep in mind that questions and answers on the site aren't just for the person asking- We're trying to build a high-quality repository of questions and answers to programming questions, so that other visitors in the future can find their answers without the need to create an account and ask questions. Deleting good content prevents this, so when given the choice, at the very least giving your found solution to your own question is more useful in the long run.

You must log in to answer this question.

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