6

Going off this question here...

Is it ok to give a jQuery answer if the OP has tagged jQuery, but does not use it in their code? It screams "mis-tag" to me, versus "gimme dat jQuery".

More or less, should jQuery answers be valid on a mis-tagged question?

(I use the term valid loosely here, as technically all answers that aren't spam or off topic are valid)

15
  • 4
    Relevant: The Many Memes of Meta, especially i.sstatic.net/TdrW7.gif Commented Oct 23, 2014 at 21:23
  • 1
    @MartijnPieters lol... jfatty and the jQuery diet plugin always kill me Commented Oct 23, 2014 at 21:24
  • It's even valid if the question is not tagged with jQuery at all Commented Oct 23, 2014 at 21:35
  • @SamIam - I hope you were being facetious.
    – Travis J
    Commented Oct 23, 2014 at 21:36
  • Let it be known that I am a huge stickler of "No tag, no answer" when it comes to jQuery. It's never valid for me. Commented Oct 23, 2014 at 21:38
  • @SterlingArcher: the scary thing is that was based on a real question; Jeff didn't have to exaggerate all that much! Commented Oct 23, 2014 at 22:12
  • @MartijnPieters oh god D: Commented Oct 23, 2014 at 22:12
  • @SterlingArcher: bah, actually, the question I found was recreating the parody, my mistake for falling for it. Bobince's original post predated it by a year at least. Commented Oct 23, 2014 at 22:22
  • 3
    Did you really expect a "thank you very much" response? Voting is anonymous at SO, do take advantage of that to avoid this kind of drama. Commented Jun 17, 2015 at 16:45
  • @gunr2171 They didn't tag with jQuery Commented Jun 17, 2015 at 16:47
  • They also didn't say "I cannot use jQuery", so if it provides a more elegant solution (I'm not necessarily saying this case does, but as a hypothetical), why should people be discouraged from providing it? Granted, vote as you see fit, but that's one perspective on it. Commented Jun 17, 2015 at 16:48
  • @eldarerathis they didn't, however jQuery is a JavaScript library, not only that the OP was clearly struggling with the concept of JS, let alone JQ. He can provide it sure, just as an alternative to some JS, not a JQ only solution. Commented Jun 18, 2015 at 0:03
  • @HansPassant No, but I can't stand it when I get down-voted and don't get notified why. How can I attempt to rectify a problem if I don't know there's a problem? He can then either update his answer to something more on topic or delete it. Commented Jun 18, 2015 at 8:35
  • It never made any sense to me to post a recommendation for an improvement and also DV the post. Just give the guy the time to follow up. If he doesn't then you can always DV later. No drama. Commented Jun 18, 2015 at 8:57
  • @HansPassant Current state warrants DV. If post gets amended to be better, I undo the DV. Potentially UV too for being a good sport. Commented Jun 18, 2015 at 9:00

4 Answers 4

19

I tend to agree with this author's rationale expressed in his comment in a discussion on this subject:

The only person here that should have issues with my answer is the poster then. Not you. I told him/her how to do it in vanilla and offered a much simpler way using jQuery. The poster can decide if he wants to use it or not.

JavaScript questions never require jQuery; C++ questions never require Boost, and I suppose it may even be possible to answer Perl questions without referencing something on CPAN. That said, there are many, many questions where the use of a tool or library makes the solution considerably easier or less error-prone; if we could not have answers that demonstrated this, the site would be much poorer.

9
  • Of course, if any particular person feels that the suggestion to use a particular tool is inappropriate in some particular context, they're more than welcome to constructively provide that feedback. Sometimes proposing someone setup a complex tool to do a very simple task is more work than it's worth.
    – Servy
    Commented Jun 17, 2015 at 16:48
  • 1
    Yes, anyone is free to express relevant opinions constructively. The critical part is that you can be wrong, but you can't be rudely wrong.
    – Shog9 Mod
    Commented Jun 17, 2015 at 17:04
  • I agree with all of that, except it being okay to give a jQuery answer to a JavaScript question. Not only that, the accepted answer to the supposed "duplicate" question agrees with me that jQuery shouldn't be answered on non-jQuery questions. JQuery is a library to make certain coding tasks easier, it's not a replacement for JavaScript. Also finally, as I said in my comment, this isn't a duplicate of that question because that is asking about mis-tagging, not purposefully not tagging. Can you unclose this please? Commented Jun 17, 2015 at 23:59
  • As someone who does heavy JS development without any jQuery anymore (it's just a waste of bytes when you're using something like React), I'd prefer that jQuery answers are discouraged for JavaScript questions from now on.
    – Andy
    Commented Oct 9, 2015 at 0:35
  • 1
    I would prefer all answers to all questions were expressed in logic and syntax suitable for a threaded Forth environment. Aren't you glad that personal preferences of arbitrary readers don't dictate which answers are allowed, @Andy?
    – Shog9 Mod
    Commented Oct 9, 2015 at 0:37
  • Well that would be off-topic for a JS question. The question is if jQuery is on or off-topic for a question tagged only as JavaScript. Or perhaps OPs should be encouraged to accept pure JS answers?
    – Andy
    Commented Oct 9, 2015 at 0:45
  • I guess my frustration is that a lot of old, very fundamental JS questions with thousands of upvotes have jQuery in the accepted answer, but as time goes on I think it will be more common for people to want pure JS answers to fundamental questions, especially in the case of questions that don't involve the DOM. And want to be able to find the pure JS answers as quickly as possible.
    – Andy
    Commented Oct 9, 2015 at 0:53
  • 1
    Perhaps we should be happy that anyone can post alternate, working solutions to questions.
    – Shog9 Mod
    Commented Oct 9, 2015 at 0:53
  • 1
    And as such things go... jQuery is not particularly complicated; any answer containing jQuery can be trivially converted to one that doesn't; this is not as true for all libraries, and we should be quite thankful that few have become so pervasive.
    – Shog9 Mod
    Commented Oct 9, 2015 at 0:54
5

Sometimes it can be hard to make grand statements about how much jQuery to use. None? Martijn's classic link depicting "needs more jQuery"?

I think each instance is kind of different and here is my take on this one.

Based on looking at this user's past history of posts they are attempting to integrate jQuery but do not really understand it very much, if at all. As a result, they tagged this question with jQuery hoping that perhaps someone would offer a solution including it so they can see how it would be used as opposed to how it would be done without using a library (plain javascript).

I think answering with jQuery is applicable in this situation, although it is definitely not acceptable to answer with jQuery when the tag is not present. I also thing that removing the tag could change the original poster's intent.

3

To me it depends on the question. If the question is

"How do I do X in JavaScript"

where X is something that's not really doable in regular javascript, but has a reasonably simple solution in jQuery, then it seems like it's a fine thing to answer with a jQuery answer regardless of whether it's tagged that way or not. The asker may or may not use jQuery, it may or may not help the asker, but it's a reasonable answer. jQuery may have a bit of a bad rep here, but to me it's like answering an question suggesting to use dplyr; it's a valid solution that could help the asker or later searchers. I'd upvote a non-jQuery solution over a jQuery solution to a question that didn't specify jQuery if it were reasonably simple to implement, but I have no problem upvoting the jQuery answer if it's much simpler.

If the question is not that, though, but is more about how JavaScript works, then a jQuery answer should only be valid if the question seems like it really does use jQuery. If it is entirely pure JavaScript and doesn't have any jQuery dependencies, then it should be answered as JavaScript and the should be removed.

3
  • So in otherwords, a mis-tagged question should not be answered with the mis-tagged language? Commented Oct 23, 2014 at 21:28
  • 1
    If the question is clearly mistagged, then edit it and remove the tag. If the question has a reasonable answer in jQuery, though, the mistag or not is irrelevant - the answer is fine. In questions where a jQuery answer is reasonable, the tag might be inviting jQuery answers; but if the question clearly shouldn't have anything to do with it, remove it.
    – Joe
    Commented Oct 23, 2014 at 21:29
  • "where X is something that's not really doable in regular javascript, but has a reasonably simple solution in jQuery" that's impossible.
    – Kevin B
    Commented Oct 24, 2014 at 15:35
2

If you feel that the answer isn't helpful, you're more than welcome to downvote it. If others feel that it is a helpful answer, despite using a tool not mentioned in the question, they may upvote it. Everyone is free to provide the feedback they feel is most appropriate.

Your first comment certainly isn't inappropriate. Indicating that the answer is problematic because the question doesn't mentoin the tool used is certainly feedback you can choose to provide.

The answerer's reply of "can't you read" is starting to push the bounds of being constructive. I could certainly see it meriting deletion by a mod.

When you reply with "Are you stupid" we've now clearly devolved completely past the point of constructive discussion and into childish name calling, and nothing productive is likely to be accomplished at this point forward. Had you removed that inappropriate name calling from the comment it could potentially have had value; if you had been able to clearly and constructively explain why you feel the answer is problematic, then either the author could use that feedback to improve their answer, or other readers can use that information to judge its quality. But when you open with personal insults, the odds of anyone actually reading/discussing anything after it constructively tend towards zero.

1

You must log in to answer this question.

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