5

I've noticed most questions seem to be "how do I..." or "what is the best way to..." questions. Are "Why are things done this way in [library/framework]" allowed?"

1
  • 2
    One "why" question with a good answer can prevent a hundred "how" questions from being asked. Sadly, in practice they will be asked anyway by people that don't care about the why and prefer SO to be a forum. What's the better Q+A is pretty obvious to me, not to everybody however. Don't hate "why", please, a comment is a sad place for the answer. Commented May 14, 2016 at 8:43

2 Answers 2

1

Short answer:

It depends.


Long answer:

'Why?' questions are allowed as long as it does not fall into the off-topic criteria:

  • off-topic because...
    Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example.

  • unclear what you're asking
    Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.

  • too broad
    There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.

  • primarily opinion-based
    Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.

On the How to ask a good question? page, there are examples listed:

Examples:

Bad: C# Math Confusion
Good: Why does using float instead of int give me different results when all of my inputs are integers?
Bad: [php] session doubt
Good: How can I redirect users to different pages based on session data in PHP?
Bad: android if else problems
Good: Why does str == "value" evaluate to false when str is set to "value"?


So,

questions that includes one of the following

  • a Minimal, Complete, and Verifiable example
  • able to be answered in a few paragraphs
  • can be reproduced

are allowed.


References:

3
  • 1
    Alright, that makes sense. My question is simple and concise, while it isn't something that would most likely vastly change how I code in most cases, an answer would provide some insight.
    – eggbertx
    Commented May 14, 2016 at 2:39
  • 4
    How, pray tell, does one provide an MCVE for, or "reproduce" a "why" question? Not every such question presents a problem that needs to be reproduced, and sometimes the question is obvious enough that such an example is unnecessary.
    – BoltClock Mod
    Commented May 14, 2016 at 4:53
  • 1
    @BoltClock I meant one of the following, updated post
    – Panda
    Commented May 14, 2016 at 14:16
12

"Why are things done this way in [library/framework]" allowed?"

Such a question is going to be Primarily Opinion Based. You couldn't provide an objectively correct answer to such a question.

It would also most likely be Too Broad. Attempting to provide a complete answer to a question like that would almost certainly not be within the scope of an SO answer.

Note, that wouldn't apply to all questions that have the word "why" in them. Asking something like, "Why does [code goes here] output [output goes here]. I would expect it to have done [expected behavior here] because [current understanding of behavior goes here]?" is (typically) a reasonably scoped question, and it's very likely to have an objectively correct answer.

You must log in to answer this question.

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