8

I asked the question What's wrong with this function to exit full screen mode?, where I:

  • Provided a link to relevant documentation
  • Provided short code that simply and precisely demonstrated my problem
  • I showed what I'd already tried & learned
  • I explained my goal clearly

But I did not:

  • Provide a JSFiddle.

I received down-votes, and responded with a short rant on how negatively people respond to questions these days on Stack Overflow, compared to how kind and positive and helpful people are on other SE sites. I was then told that I should have provided a JSFiddle.

I agree that providing a JSFiddle is helpful, and I usually do so, however I don't believe that a question should be down-voted for not providing one. Perhaps it would be appropriate to withhold an up-vote, request a JSFiddle in the comments, and up-vote if one is provided (and the question is otherwise clear).

I would be happy to improve my question in any way possible, however it's pretty.. well, discouraging, to receive downvotes right away without any comment why, or suggested improvement.

Should JavaScript questions be down-voted for not providing JSFiddles?

6

2 Answers 2

23

Personally I think it's incredibly unfair to expect an asker to provide a fiddle in every question just because it could benefit from one. If all the code that is necessary to recreate a fiddle is in the question, then anyone else can just make one themselves without having to burden the asker.

If you have only provided one aspect of the code, such as only HTML, or only CSS, or only JavaScript, then generally you will want to provide the others for context, unless the problem truly is localized to just that one aspect (e.g. if your JavaScript function is not getting called elsewhere in your script and it has nothing to do with the DOM). Otherwise it becomes more difficult to pinpoint the problem unless the problem is really obvious, or the problem lies in just the code you have provided, or someone is really good at psychic debugging (and people hate that phrase so much I bet I'm going to get downvoted just for saying it).

If that's the case, then the reason people want you to provide a fiddle is so you can show that you have been able to reproduce your problem in a reduced test case.

Frankly speaking, I would personally rather downvote a question for linking to a fiddle then circumventing the quality filter by including a bogus code block instead of the real code, than a question that contains the code within the question and everything else you have mentioned but simply without a link to a fiddle.

In other words, I don't really care whether you provide a fiddle as long as you can demonstrate within your question itself that you have done your research, you understand the problem you are facing, and have provided the necessary code within your question. Anyone can downvote for any reason they like, but I agree that it's a little unfair to downvote solely for not linking to a fiddle.


Note that your original question was indeed not quite up to snuff. A code dump with no problem statement is not a good question; we want you to explain the specific problem you're facing, including any errors(s) you may have encountered (or if there was no output at all). Having a specific goal is often not enough for us to pinpoint the problem; if you explain the problem statement instead, then we know exactly how to answer your question, and we can sometimes even presume the end goal based on the problem statement.

However, that's not really because you did not provide a fiddle. That's simply because your question was not sufficiently explained. Which it is now, thanks to the comment by Gaby aka G. Petrioli.

1
  • 1
    "or someone is really good at psychic debugging (and people hate that phrase so much I bet I'm going to get downvoted just for saying it)" +15/-0\
    – Braiam
    Aug 25, 2014 at 21:56
1

I think it's perfectly acceptable to post a question without a fiddle, as long as the relevant code is included. Fiddles/Codepens/Plunkrs etc. are generally only necessary when someone needs more assistance than can be given by a snippet. I often ask for a fiddle when it's pretty clear that the OP hasn't even made an attempt and is just looking for someone to write the code for them or if they are asking for extended help that requires recreating their scenario first.

You must log in to answer this question.

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