28

I am active mostly on and . Of late, I am seeing many users asking for a fiddle for everything like this or this

Is it good to ask for a fiddle in the comments? It's for the community to decide.

14
  • 22
    Why shouldn't they be allowed to ask? If the OP doesn't want to, they don't have to.
    – J. Steen
    Commented Jul 10, 2014 at 11:14
  • 60
    There is a subset of this issue that annoys me to no end: when the questioner has made the effort to post all the relevant content (markup, styles, scripts) in their question, and the first comment they get is "please post fiddle". This feels rude because in that situation, if the commenter really insists on a fiddle, they have all the information they need to create one themselves. Commented Jul 10, 2014 at 12:00
  • 12
    @FrédéricHamidi Agreed. But they're still within their rights to ask. =)
    – J. Steen
    Commented Jul 10, 2014 at 12:21
  • 26
    @Frédéric Hamidi: It speaks volumes about just how dependent people have become on that site. The comments themselves are getting close to whathaveyoutried levels of annoying.
    – BoltClock Mod
    Commented Jul 10, 2014 at 14:13
  • 1
    @BoltClock, indeed. That's not a good thing for a would-be self-contained knowledge base, I wonder if there is a reliable way to curb this (apart from banning such comments). Commented Jul 10, 2014 at 14:15
  • @BoltClock: It's the same problem when posting a twitter-bootstrap question, people want links to bootply.com Commented Jul 10, 2014 at 15:14
  • 9
    @canon, In my opinion absence of fiddle should not be demotivate you from answering and question in itself doesn't become unanswerable.
    – Satpal
    Commented Jul 10, 2014 at 16:01
  • 5
    Next thing you know they will be filtering comments for people asking for fiddles. Come on people, let it be, as annoying as it is it is also annoying for the people who answer to have to create the fiddle for the op.
    – JonH
    Commented Jul 10, 2014 at 17:24
  • 7
    Only a subset of questions even benefit from running the code over just reading the question. But then, there's a subset of questions that the asker would probably learn more if they attempted to run the code in a jsfiddle before ever asking the question in the first place.
    – Jason
    Commented Jul 10, 2014 at 17:39
  • 3
    Another dimension to it is that many times, after having answered appropriately with code and explanation and the things, I am pestered by the Op for a fiddle!! :?
    – Abhitalks
    Commented Jul 11, 2014 at 6:41
  • 1
    @abhitalks, That is a very annoying situation. I have deleted my answer few times in such scenario and moved on(OP doesn't deserve my help).
    – Satpal
    Commented Jul 11, 2014 at 6:46
  • There are questions that need a few rounds of ping-pong between the author and the one who attempts an answer. Having a fiddle to work with is just like continuing the discussion in comments: a more interactive approach. These questions usually are very close to being closed as "unclear what you are asking" and the author does not really understand his question himself. People should vote to close or ask for clarifications, not a fiddle. Commented Jul 11, 2014 at 9:51
  • 1
    @BoltClock, if people rely too much on jsfiddle (and that obviously causes problems regarding SO trying to be self-contained), perhaps SO should host its own equivalent?
    – Bruno
    Commented Jul 11, 2014 at 22:17
  • What the hell is a fiddle ?
    – Chani
    Commented Jul 12, 2014 at 15:55

5 Answers 5

35

I often see questions that don't have enough information to diagnose the problem, and then immediately under the question there will be 2 or 3 comments asking for a "fiddle" rather than asking the OP to post the necessary code/info in the question itself.

Encouraging users to post their MCV example in the form of a fiddle and not in the question, is more than a little counter productive. If all the required info/code lives on jsFiddle the question can and should be closed.

Don't get me wrong I like jsFiddle, it's a really useful tool when it comes to isolating, debugging, and sharing code snippets, but they should be treated more like french fries. They are a great side item and they pair well with an awful lot things, but they aren't an entree and its not healthy to try to use them to replace a meal.

tl;dr
There's nothing wrong with asking for a fiddle provided that it is not a replacement for asking for the appropriate information/code to be posted in the question.

0
48

From my experience, having a fiddle that demonstrates the issue helps you get more attention and therefore get a better answer.

Without a fiddle in some cases (not all), the onus is on the people answering to either digest all of the code, looking for issues, or create their own fiddle to try to replicate the issue.

If I see that someone has gone to the effort to make a fiddle that allows me to see the issue first hand and start hacking, I feel that they have gone the extra mile to get an answer by doing the ground work required to recreate an issue, and therefore I'm more likely to answer.

In summary, I have no issues with asking for a user to create a fiddle, if it's not a simple copy and paste job for me, because if they really want help, it's the least they can do.

10
  • 16
    Personally I get amused when I see commenters stuck on "without a fiddle I can't help you", only for me to slide in, find the problem, post a comment/answer as appropriate and resolve the issue without needing to run the code :D Commented Jul 10, 2014 at 15:11
  • 10
    Posting a jsfiddle makes it easy to visualize the problem, but it's not like in the C/C++ tags we are making people post snippets to ideone.com. So it's helpful but if all the relevant code is there, people should go create their own fiddle if they can't figure it out by looking at the code. I have done that in the C/C++ tag when I want to run the code. Commented Jul 10, 2014 at 15:12
  • 4
    Too many rely on the site, that's the problem. If they've posted their code, it doesn't HAVE to also go on jsfiddle. Not every PHP question posts their code on writecodeonline.com. People are using the site almost as a rule, that if it's not on there, it's not solvable.
    – Albzi
    Commented Jul 10, 2014 at 15:13
  • 5
    Side-note: For those who DO rely on jsfiddle, but they've posted code and not a direct link to a fiddle, you can use this Chrome extension
    – Albzi
    Commented Jul 10, 2014 at 15:16
  • 19
    @Niet the Dark Absol: You're tempting me to respond to questions with fiddle link and no code, by ignoring the fiddle link completely and saying "without seeing your code I can't help you"
    – BoltClock Mod
    Commented Jul 10, 2014 at 15:19
  • 2
    @staticx I agree, if everything is there and it's just a copy and paste to create a fiddle, that's fine. I'm referring to cases where snippets of code wouldn't work without the code they've omitted.
    – Tanner
    Commented Jul 10, 2014 at 15:23
  • 1
    @Tanner: That would be a problem whether you had jsfiddle or not. It's a problem in all the tags. If you post C++ code but don't show me your header because it's relevant, I am going to ask for more code. The only time I /might/ ask for a link to ideone or do it myself is if the result is different than what the user expects. Usually a different compiler or environment Commented Jul 10, 2014 at 15:37
  • 1
    Comparing C++ tags doesn't really work because with HTML and CSS it is easy if not trivial to show it in the browser. Does using a fiddle harm SO? If not (I don't think it does) if you can, why wouldn't you? Commented Jul 10, 2014 at 15:40
  • @JoshuaDance: It's trivial in ideone to post a snippet and have it compile too. Actually it would be nice if people posted in ideone because then it would force people to post a good SSCCE. Usually in those tags, we tell people to give us a SSCCE, but don't mandate it be posted to an external site. Commented Jul 10, 2014 at 15:43
  • On the sscce site, it even says: "we are also not suggesting an example is, or should be, compulsory." It seems like a jsfiddle link is starting to be compulsory. If the code produces the problem is clear and concise, a jsfiddle shouldn't be required. Commented Jul 10, 2014 at 15:49
14

To me, a jsFiddle isn't required, but what it does tell me is that the problem is reproducible. It also proves that the problem has been isolated, meaning that it exists somewhere within that fiddle.

Without the fiddle, who knows, maybe the problem isn't within the posted code at all. However it shouldn't be required. The question poster is in no way obligated to put it in a fiddle, especially if they don't use it as a development tool, and the question alone should be sufficient. If the problem or code is complex, it may not be trivial to fiddle that code.

The fiddle definitely helps though. It gives a working environment for both the questioner to demonstrate the problem, and for the answerer to solve and demonstrate the solution (e.g forking the fiddle, solving and linking in the answer).

So I would say this, the lack of a fiddle doesn't demotivate me from answering, but on the other hand, the presence of it motivates me to answer even more.

1
  • 1
    Indeed. Having a fiddle makes it so much easier. And especially the ability to modify it, and respond with the updated fork. It's no necessity, but it makes it a lot easier.
    – GolezTrol
    Commented Jul 11, 2014 at 9:53
7

Yes, this seems fine to me, but usually the problem is often that there's not enough info to answer the question, and a fiddle may not be enough. So, I tend to ask for fiddles (js, sql, whatever) like this:

Please include relevant code in your question to repro the issue, if at all possible backed by a jsfiddle.

I usually handcraft the comment to suit the question, varying a little bit. Whatever you do though, guide users to including code in the question, using fiddles only as a convenient addition.

4

I see where you're coming from and would tend to agree. Fiddles are very useful but they are also external links, and all code should be in the question.

What we really want is a question about JavaScript, or a question about CSS, or a question about HTML; to my mind, if your question needs to demonstrate an interaction between two or even three of those technologies at once (which is where Fiddles become required), it is too broad.

I'd like to see an end to these comments. Questions on Stack Overflow should be terse enough not to require fiddles in the first place.

That being said, half the time it seems that "please show fiddle" is a lazy, passive-aggressive substitute for everything that I just said; instead of writing that comment, simply close the question as too broad.

2
  • Couldn't say more I'd like to see an end to these comments.
    – Satpal
    Commented Jul 11, 2014 at 10:42
  • 3
    These three languages were basically made for one another - a good majority of questions will involve an interaction between two or more of them, but not often in a way that would make the questions too broad. You've probably dealt with a fair share of these questions yourself. If a question is too broad it's probably for other reasons.
    – BoltClock Mod
    Commented Jul 11, 2014 at 10:48

You must log in to answer this question.

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