30

I hope this is the right place to ask this question.

I opened a question SO and it was almost immediately closed by a moderator with the reason

Closed this as the only two possible answers are "yes it is" or "no it isn't".

I'm a long time SO user and I didn't remember this rule, so I searched here:

But in none of these threads was I able to find a rule that explains the reason why the question was closed.

Can you help me to understand?

What I can't understand, is that if I had opened the question with no context, then people would probably have asked me "what have you tried"? I added my context, and the question was closed because it's only a yes/no.

Moreover, this statement is not correct. In fact, an answer to a yes/no question can contain several additional details, as you can see from the comments. People are suggesting improvements and alternatives.

28
  • 6
    Methinks this is another example of overmoderation. Some community-building guru should chime in about now...
    – user224524
    Commented Jun 5, 2013 at 16:54
  • 24
    Why not run the query and see if it works? If it doesn't, post what's wrong. This would make a much better question than "Is this query correct?" Commented Jun 5, 2013 at 16:56
  • 4
    @BilltheLizard there is a reason for that, I assumed I should not have to explain that. This is a very large database with sensitive data, since the resultset is large as well I need to be sure the query is correct before running a delete. Checking the resultset one by one is simply impossible. After all, what's wrong about asking whether a query is correct? I might not be able to run it for a variety of reasons. Commented Jun 5, 2013 at 16:58
  • 10
    Then use a smaller data set to test with. Commented Jun 5, 2013 at 16:59
  • 12
    @SimoneCarletti - this is context that should be part of the question (in addition to an actual problem).
    – Oded StaffMod
    Commented Jun 5, 2013 at 16:59
  • 6
    @Oded I believe it's simply absurd I have to justify myself for asking a question that I could possibly check on my own. If I'm asking it there should be a valid reason, I can't believe the question was closed just because I didn't explained I can't run it on my own. Commented Jun 5, 2013 at 17:04
  • 3
    @SimoneCarletti, no, you absolutely my justify it. Too many people simply ask without ever trying. That query is simple, so just run it, or create a smaller repro you can run. Plus it's not entirely an undiscussed topic. Search. Commented Jun 5, 2013 at 17:06
  • 3
    Ahead of you on that one. Already voted to close as a duplicate. As said, this is a very common query people execute. Easily findable. There are doubtless dozens of duplicate candidate questions. Commented Jun 5, 2013 at 17:10
  • 4
    @landons Yes, actually, it is. Remember, it's goal is to provide a repository of knowledge, not just to help individual users with their problems and then being "done". Helping individual askers is the side effect, not the goal. Answering duplicate questions doesn't further SO's goal, which is why it actively works to close those duplicates, not hold the hands of users, avoids localized questions, etc.
    – Servy
    Commented Jun 5, 2013 at 17:15
  • 3
    @landons, we are not open to laziness and redundancy. No sympathy here. And I hate to sound harsh, and I am sure the OP is an outstanding person, but this is not the type of question or effort we should accept. New user, old user, high or low rep, it should not matter. Commented Jun 5, 2013 at 17:15
  • 3
    I'm not asking for your sympathy, only that you don't kill my favorite online community because of your "standards."
    – user224524
    Commented Jun 5, 2013 at 17:17
  • 5
    @user414076: Laziness like not setting a sensible username? ;-)
    – Orbling
    Commented Jun 5, 2013 at 17:17
  • 5
    @landons And I'm asking that you not kill my favorite online community by trying to remove its standards. After all, virtually every other programming q/a site/forum has virtually no standards. If you want to find a place with no/low standards you have a lot to choose from. SO is set apart because it's one of the few places that does have standards, and they're very high. Removing them, or lowering them significantly, would turn SE into every other programming forum.
    – Servy
    Commented Jun 5, 2013 at 17:17
  • 3
    @Servy Touche. I see the tension here, but do you at least recognize that some of us are feeling too policed here, and the community provides value even when the "standards" say a particular question couldn't?
    – user224524
    Commented Jun 5, 2013 at 17:21
  • 3
    @landons I fully realize that there are lots of high quality questions that, due to the site's guidelines, cannot be asked/answered here. SO isn't designed to be able to answer any kind of question. Yahoo Answers does, and see where that got them. In order to have high quality content it's important for various sites/communities to narrow their scope such that they can tailor their functionality, guidelines, rules, community, etc. towards that scope. The broader the scope, the lower the quality.
    – Servy
    Commented Jun 5, 2013 at 17:25

5 Answers 5

30

When asking a yes/no question there are one of two possibilities:

  1. You really want a yes/no answer. If this is the case, and you don't need anything else to answer your question then it means the answers will be inherently low quality. An answer that only says "Yes" or "No" (in addition to not meeting the minimum length) would be of very low quality. SO answers expect more.

  2. You don't actually want a yes/no answer, in which case your real question is not actually a yes/no question, and you're hoping that people will determine what your real question is. For example, someone might ask, "Can I do [...]?" when what they really meant to ask was, "How can I do [...]?"

Almost all yes/no questions I've seen fall into case 2; they should be edited into a question that isn't really asking for just a yes/no, it should be asking to explain something. (Even if it has a yes/no in there somewhere.) Note that just adding "Explain" at the end isn't really a good way to go about this; you should refactor the question on a more fundamental level.

To cover your specific case of a question in the form of "Is this correct" you can refactor it to something like, "Under what circumstances, if any, will the following code not [...]".

So while some of these yes/no questions can be of low enough quality that I can understand closing them, almost all (including yours) are capable of being edited into a question that isn't a yes/no question, and that is encouraging high quality answers, as such questions of this form should have a higher rate of reopening (after some simple editing) than many other types of closed questions.

2
  • 1
    What is the OP just wants "yes/No" and "Here's why:"?
    – J.Todd
    Commented Oct 31, 2014 at 21:58
  • 6
    @jt0dd That's effectively the second case. It's expecting an explanation of something, and the question needs to be clear about what that something is. As I said in my answer, such an explanation may well include a "yes" or "no" in there, but there needs to be a clear expectation of something being explained, as well as that thing being well defined.
    – Servy
    Commented Nov 3, 2014 at 14:47
28

Well, it's not just because of it being a yes/no question, but because of the way the question is asked.

If the answer to your question is "yes" then there was never a problem and thus never a real question in there anywhere. It then becomes more of a Code Review problem as people try to explain things you could have done better, which is off-topic for Stack Overflow.

If the answer to your question is "no", well, all I can say is you should already know if it's working or not. You wrote a query, why didn't you just try running it? Then you could explain the problem you're having and ask for help on why it doesn't work. If you did run it, you could easily rephrase the question to reflect that and make it much more acceptable.

25
  • 6
    I politely disagree. Asking "Is this right?" shows a desire to learn (perhaps, a better way) that should be encouraged on SO.
    – user224524
    Commented Jun 5, 2013 at 16:58
  • 16
    @landons: Not really when you could easily test if it's right in a few seconds.
    – animuson StaffMod
    Commented Jun 5, 2013 at 16:59
  • 2
    But then Lamak would not have had the opportunity to point me (and maybe others) to the suggestion of using NOT EXISTS over LEFT JOIN / IS NULL.
    – user224524
    Commented Jun 5, 2013 at 17:00
  • 4
    @animuson True, but it's not always that easy to see if a given solution will work. Perhaps it will work for some sample inputs but not others. That said, I'm not really a fan of the "is this right" form of question.
    – Servy
    Commented Jun 5, 2013 at 17:00
  • @animuson There are a variety of reason why I could not be able to test it. Why do you assume I can? Commented Jun 5, 2013 at 17:00
  • 2
    @landons That's still a codereview kind of question in which you're asking for perferable implementations of already working code; technically that's not an answer to this question, it's an offtopic tangent.
    – Servy
    Commented Jun 5, 2013 at 17:00
  • @Servy It was helpful to me, and it's rare that I learn new stuff on Stack Overflow. Should we send people over to codereview.stackexchange.com instead?
    – user224524
    Commented Jun 5, 2013 at 17:01
  • 6
    @SimoneCarletti Because you haven't demonstrated what you've tried. If you had, for example, given a few example inputs that you've tried that worked, and that you've done some testing but are unsure if your testing is exhaustive, then that would go a long way in my eyes. Particularly if there is something that you're unsure of it's ability to handle that you can't test. Do you have some particular reason to believe that it won't work?
    – Servy
    Commented Jun 5, 2013 at 17:02
  • @landons If what you want is a review of your code, then yes, go to code review. If you want to fix code that's not currently working instead, then it's appropriate to post on SO.
    – Servy
    Commented Jun 5, 2013 at 17:03
  • 5
    @SimoneCarletti - There are a variety of reason why I could not be able to test it. Why do you assume I can? - why should we assume you can't? Look at it from an outsider perspective, we know nothing other than what you post. So we can either make all the crazy assumptions in the world, or you can give all the data (or reasons why you can't) so that there is no ambiguity. But you shouldn't ask why we assumed one thing instead of something else.
    – Mike
    Commented Jun 5, 2013 at 17:04
  • 1
    @Mike I don't have 10 points of reputation, I believe you can safely assume that if someone with 50k reputation is asking a question is because he actually needs an answer. Or not? Commented Jun 5, 2013 at 17:06
  • 8
    @SimoneCarletti Not. People with 50k rep can be lazy, just as a 10 rep user can put in a lot of time and effort. Don't just assume that we'll assume you've put in a lot of time/effort into solving your problem, show us that you've put time and effort into solving your problem. We're asking new users to do that all the time in their questions. Your questions are not held to a lower standard because of your rep. In fact, given that you know the rules that much better, you should be held to a higher standard.
    – Servy
    Commented Jun 5, 2013 at 17:11
  • 4
    @landons Really? He didn't even try running the query at all. Seems pretty lazy to me. Oh, and all of the people involved in this comment thread aren't mods, they're just community members. You should also avoid personal insults; we're here to constructively and politely discuss the issue, evaluate the consequences of various actions, and attempt to come to a consensus for what to do. There is no need to insult people to do that.
    – Servy
    Commented Jun 5, 2013 at 17:22
  • 5
    Moderator Note: If you leave comments that are inflammatory, you risk them being deleted. I can't believe I actually have to write this, but there it is.
    – George Stocker Mod
    Commented Jun 5, 2013 at 17:27
  • 1
    @SimoneCarletti That question would have also likely have been closed as a duplicate, because "how can I do that" has been answered many, many times before.
    – Aaron Bertrand Staff
    Commented Jun 5, 2013 at 18:23
16

Stack Overflow is not just a 'get an answer for me' place, it's "Produce quality content that is useful for people who follow". In the case of your question, the second part is lacking, and the first part isn't really helpful to anyone else.

Here's what I mean:

I need to select (and eventually delete) all records from tableA (foo) where there are no associated records in tableB (bar). The association is a one-to-many association.

You start out really well. You explain the problem.

But then, you ask a question that isn't useful to anyone else:

Is the following SQL query correct?

Let's say the answer is Yes, what happens?

You have an answer that says

Yes (insert text to meet 15 character limit).

Imagine what a person who searches for your problem will see? They're hoping for information, and all they have to go on is an answer that isn't helpful.

You could argue that's a function of a bad answer; but I argue that bad answers come from bad questions. Good questions could have bad answers, but they're not explicitly asking for them. What all bad questions have in common is that they're not asking for something that has the potential to be useful for others.

To improve your question, you ought to try something. You know when you run this query whether or not it's correct, and if you can't run it on a data set, you should download AdventureWorks and use that (or your DBMS's equivalent).

It's not too much for us to ask you to put effort into your question, and figuring out whether or not your query is correct (and showing us the output if it's not correct) falls squarely on your shoulders.

5
  • 1
    I actually spent a lot of time trying to come out with the final query and validating the result. After that, I decided to ask to get the final confirmation. May be I should have explained all of that, but that was beyond the scope of the question from my POV. May be I was wrong. What hurts me is that I saw tons of questions composed by cut/paste of error messages answered with no objection, despite all the effort I put trying to create a good answer, I have been flagged as lazy. :( Commented Jun 5, 2013 at 17:43
  • 3
    @SimoneCarletti It's not terribly relevant that you demonstrate the effort you spent coming up with your solution, since that's not your question. What you didn't demonstrate at all is the effort that you spent testing you're solution, because that's what your question is about. In order to know if it's correct you'll have needed to test it, but you didn't describe what types of tests you have and haven't run, so that readers can know what you need help with.
    – Servy
    Commented Jun 5, 2013 at 17:46
  • 1
    @Servy Please take a look at the "it doesn't work" Git, JavaScript, HTML, etc questions and let me know in how many of them you can see the effort of the author to find a solution... however, they are answered without a single objection. Commented Jun 5, 2013 at 17:48
  • 4
    @SimoneCarletti I'm not particularly active on those tags for starters, but note that 1) not putting in effort makes a question of low quality; that doesn't mean it can't/shouldn't be answered. As per my answer here, your question wasn't closed because you didn't demonstrate effort (but that is likely why it's gotten a lot of downvotes). 2) The fact that some other question or questions is treated differently doesn't mean this question should be treated that way. If you notice problems elsewhere then we should address those problems, not emulate those problems when it benefits you.
    – Servy
    Commented Jun 5, 2013 at 17:52
  • 6
    @SimoneCarletti, you're preaching to the choir if you're talking about other low quality questions getting answers anyway. Frankly, we have to do a better job policing those, as well. Commented Jun 5, 2013 at 17:54
4

Actually, yeah. This was a great question from a research effort stance, but it left the answerers with very little to work with. Just... "uhhh yep, looks good? What were you worried about?" Would be very helpful if you answered one of these questions:

  • "I ran it and it worked, but here's why I'm concerned I didn't do it right."
  • "I couldn't run it for this reason."
  • "I ran it and it didn't work right, here's the problem I had."

So take this as a "light closure, as in, not quite answerable, improve it a little and it can be reopened. I do sympathize that it's somewhat problematic it got closed before you had any chance to improve it, but alas, that is our current workflow - and if you do make this improvement it can be easily reopened. Please don't take this too personally, we need members like you who are willing to put up with a certain amount of B.S. so we can, for instance, improve our close-workflow.

2
  • I think the workflow could be improved.
    – user224524
    Commented Jun 5, 2013 at 17:09
  • @user224524 yes, see the discussion in the linked answer, as well as all of the discussions linked in linked answer.
    – djechlin
    Commented Jun 5, 2013 at 17:48
3

Personally I think the choice of close reason was probably not the best. At a minimum the wording could have been trivially changed to:

Is the following SQL query the best possible way to get this result?

...to bypass the original close reason. That, to me, is a valid question.

However, this is most definitely a duplicate question and could have been closed as such - but that is harder since there's often substantial effort in finding the "best" dupe to point to.

I think in this instance the closure was a little heavy handed, especially given that it was a unilateral closure by a developer (not an elected community moderator) and it happened 2 minutes after posting.

That being said, it's not that hard to get a question reopened - remember that "closed" questions are really more "on hold" until they can be improved.

4
  • I think that scope is implied by "Is this correct." We all go straight to potential problems/optimizations...
    – user224524
    Commented Jun 5, 2013 at 16:59
  • 1
    @landons It's implied but the Q was closed because it wasn't explicit...if it had been worded as I wrote above it couldn't have been closed with the stated reason.
    – JNK
    Commented Jun 5, 2013 at 16:59
  • 3
    I find "is this the best way to do X" or "What's the best way to do X" a problem as well. You should simply be asking, "How do I do X" and the best answer will float to the top. That's how SO works.
    – Servy
    Commented Jun 5, 2013 at 17:08
  • 2
    @Servy Thanks for explaining SO to me, I didn't realize that :P But seriously, asking for a "best" way is fine. It's even better if you specify from what perspective - most stable, fastest, etc.
    – JNK
    Commented Jun 5, 2013 at 17:11

You must log in to answer this question.

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