(to anyone who answered my questions in the past: Please don't take this the wrong way! No offense intended!)

I sometimes ask a question where I try to reduce my actual use case to a more simple example. E.g. something with animals and flowers.

Or I present a choice between two alternatives, trying to find out which is better.

Sometimes, instead of addressing the question, people question the (possibly flawed) metaphors, or the given alternatives.

E.g. I would ask "Should I go by bike or walk?" and then someone would say "Take the bus.". Or if I give a simplified code example, someone might say "foo() is a stupid function name." or "Why would you write a class to calculate 1+1?"

I think the problem here is that the answerer does not know why I constructed this bike vs walking alternative. Maybe I really don't know that buses exist. So then "take the bus" would be the perfect answer. Whereas if you assume that I really only have those two available, the correct answer might be "bike is faster, unless it is a very short distance.".

I think a better answer in such cases would be "I personally would take the bus. But if I had the choice between bike and walking, I would take the bike. Only on short distances I would walk.". This addresses both the literal question as well as the situation where the asker did not know that buses exist.

So my question here would be: Do I need to ask my questions in a way that avoids "take the bus" answers, or should we instead tell answerers to assume that there are "reasons" why a question is asked the way it is, and accept that "take the bus" is outside the scope of possible answers?

I intend this thread to be generic. But in case you are wondering, the Q/A that led to this post was this: Parameter to control whether to throw an exception or return null - good practice?

By no means do I want to debase the answer and effort by Ewan. It just did not address the main thing I was looking for.

  • 2
    Ask a better question, get a better answer ... If a question is worded in terms of some analogy, and an answer, which may fit well to this analogy, cannot be transferred back to the original problem, then the analogy probably was not good, I guess.
    – Doc Brown
    Dec 24 '17 at 18:38
  • 1
    Related on MSE: Why don't people RTFQ?, and lots of similar linked from there, such as Alternative instead of real answer.
    – jscs
    Dec 25 '17 at 15:35
  • Thanks @JoshCaswell. I posted my own thoughts here, meta.stackexchange.com/a/305055/166835
    – donquixote
    Dec 25 '17 at 20:00
  • If a few guys write bad answers, it's just a few guys writing bad answers. If it's most everybody writing bad answers, it might just be one guy writing bad questions.
    – Patrick87
    Jan 25 '18 at 18:04

So my question here would be: Do I need to ask my questions in a way that avoids "take the bus" answers, or should we instead tell answerers to assume that there are "reasons" why a question is asked the way it is, and accept that "take the bus" is outside the scope of possible answers?

Neither. No matter how hard you try, you can't restrict answers to give a blank-and-white choice between A or B.

In many design questions, it can be very beneficial if someone gets to it with a different background and appears to give an answer that is completely outside the box for the OP. It can be helpful, because it shakes up the preconceptions that may no longer be valid.

If someone gives an answer that is completely unhelpful to you, you can choose to simply ignore the answer or you might downvote the answer.
The answer can still be valuable to someone else who has a similar question and stumbles on your post.

What you can do to get good answers is to make sure that your analogy or simplification is still a good representation of your actual problem. Especially using only meaningless names, like foo, can mask the real problem you are having. If people comment on that, or you aren't getting answers that address your real problem, you should consider rewriting the question with more meaningful names.

  • I would say a good answer does both things: Step out of the box that the asker defined, but also address the original question to give them the benefit of the doubt.
    – donquixote
    Dec 24 '17 at 13:54
  • @donquixote: For a good answer, that holds true. But only a small portion of all answers are good answers. It is hard and time consuming to write a good answer and that is not giver to everyone every time. Dec 24 '17 at 14:21
  • 1
    +1 note this answer does exactly that- from two alternatives presented by the OP, it picks "the third" one.
    – Doc Brown
    Dec 24 '17 at 18:34
  • @DocBrown This is true. In this case, it was safe to assume that the two alternatives provided were not because of some constraint that would exclude other answers, but because I could not think of anything else.
    – donquixote
    Dec 25 '17 at 19:24
  • 1
    @donquixote if you ask me which is the best kind of screwdriver to use on a nail I'm not going to consider philips and flat heads. I'm just going to say hammer. If you want me to stay in the box you had better have a pretty convincing story about why I have to stay in this box. Jan 5 '18 at 6:32
  • If you say "X or Y?" and the response is "consider Z" then perhaps you are asking an XY problem.
    – user22815
    Jan 16 '18 at 18:07

I think it would be better to be more specific and highlight the questions you are talking about. I've reviewed all your eleven questions, and found only two which seem related:

(Side note: you rarely accept answers, even when they look good enough; any reason for that?)

Even if I haven't found the relevant questions, I think I see what you're talking about, since it occasionally happens to me to answer questions here in a way which is different from what the original posters expected. Among the recent ones, my answer about logging practices is an obvious example.

Therefore, I'll give you my perspective. There are two reasons why the answer may chose a different path than the ones which were invited by the question:

  • XY problem: very often, questions which suggest a straightforward answer are based on incomplete data. Either the person who asked the question was unaware that he didn't provide enough data, or maybe he was even unaware of his actual problem in the first place.

    Basic example. A colleague asks me how to write a regular expression to replace specific entries in text. I ask him why is he doing that (I could have just answered). It appears that he's trying to put the list of entries in a form of JSON dictionary. Asking him for further details, I discover that he did a SQL query which gave the entries in a specific format, and he needs to change this format. It appeared that he only had to make a basic change in the SQL query to have the result which looks like a JSON dictionary with only leading { and trailing } missing.

    What is often indicative of an XY problem is that the question doesn't make too much sense. For instance, “Should I go by bus or take a taxi to the closest supermarket?” doesn't make sense coming from a person who is at the entrance of a supermarket, so the first thing to do is to ask for context. Maybe the person wants to go to a different supermarket? Maybe the person is visually impaired? Or maybe it's some sort of a joke?

    Unfortunately, XY problem may be much more difficult to notice. A year ago I've presented an example of such problem that I was unable to discover soon enough.

  • Scope problem. For a person is in a given situation, it is not unusual to think within a specific scope. If the problem cannot be solved from this scope, the person is either unable to solve it, or will do it in a very contrived way.

    I have an impression that in software development, the scope problem occurs more frequently than in other domains. At least, it happens on regular basis to me, and it happens to the people who ask me questions as well.

    One of my favorite examples is the case I documented on Workplace.SE. As a consultant, I was asked a straightforward question, and I gave a straightforward answer, without giving any thought outside the scope of the question. If only I gave it a thought...

    This is the benefit of sharing problems with others. It can be as basic as pair programming or asking a programming question to a colleague. How often to a “How do I...?” have I received answers such as: “Why would you do that in the first place?!” Sometimes it's harsh, but most of the time, it's helpful to see a different perspective that you haven't envisioned. On regular basis, such situations translate into tasks performed in a matter of minutes, rather than days.

    This is one of the values of SoftwareEngineering.SE: your question gets read by persons who think differently than you, who envision your problem in a way you didn't, and who can give a solution you never imagined.

And then:

  • There are persons who misunderstood the question in the first place. It happened to me too; after posting the answer, I receive a comment telling that I misinterpreted the question, and I usually end up removing my answer, since it has no value whatsoever. If you do get a lot of answers like that, make sure the next time your question is clear. If not, politely explain to the person who answered that he misunderstood the question, and possibly try to reformulate it.

  • Some users will try to fit their vision into any problem you have. You've probably seen it in different forums where it takes a form of trolling:

    — Please, can you tell me how do I do X in Windows?

    — Why! Install Linux, it's so much better!

    Although those cases are very rare on Stack Exchange sites, they still exist, unfortunately. It even became popular on StackOverflow concerning JavaScript questions: “You can do it; use jQuery.”

    In those situations, it's better to specify the scope. Commenting an answer is not enough; edit the question itself. “Note: I'm looking for a pure JavaScript solution; I know I can do it in one line using jQuery.”

  • "Side note: you rarely accept answers, even when they look good enough; any reason for that?" -> thanks for reminding me, I will check.
    – donquixote
    Jan 6 '18 at 1:50
  • About the "adapter pattern" question: I had a specific reason to use an "adapter factory" object, but this reason was not obvious due to simplification of the question. So I got the classical "you don't need this". What I get or assume from the answer is that such an "adapter factory" is too rare to have a wide-spread naming convention. The answer does not explicitly say this, but I can draw sufficient conclusions I think.
    – donquixote
    Jan 6 '18 at 2:07

There are times when I want "smarter than you" answers and other times when I don't.

In the latter case, I might a append to the question, "Please limit your answers to walking vs. bicycling."

In other instances, when I want information about "transportation," I would at minimum, leave out the "appendage." Or I might say, "My usual means of transportation are walking and biking, but please feel free to discuss other means of transportation" That could include trains as well as buses, and in some (rare) cases, even e.g. boats or helicopters might be an acceptable answer.

  • I try to do the same, e.g. I would say "Assuming there are no other vehicles available". But some people still answer outside of the given constraint. I think this is ok as long as the answer covers both cases.
    – donquixote
    Jan 4 '18 at 20:03
  • Also consider that what you need can be different from what other readers need.
    – donquixote
    Jan 4 '18 at 20:04
  • @donquixote: That's a reason for not limiting the answer to bicycles or walking.
    – Tom Au
    Jan 4 '18 at 22:52
  • Honestly, a text like "Please limit your answers to walking vs. bicycling" screams for an explanation why this constraint is given. And if the asker can't present a good reason for this, it makes the question a candidate for either ignoring that constraint, or voting to close as unclear. On the other hand, if the question is written well, with enough scope and background information, such a "Please limit ..." request would probably not be necessary.
    – Doc Brown
    Jan 9 '18 at 15:20

You must log in to answer this question.

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