8

Every so often, somebody asks a question about a piece of code, but the piece of code that they give is too abstract and unrealistic.

For example, there's a question on the front page right now about an abstract class called Base, with subclasses called A, B, and C. Classes A and B both have a field called _field1. The question is whether or not _field1 should be moved into Base.

In my opinion, this question is badly posed, because the asker has left out critical information: namely, what Base, A, B, C, and _field1 actually are. If the asker had told us what those classes and that field are, then we would be able to give a meaningful answer going into detail about the advantages and disadvantages of doing it each way. Instead, we have to give an answer which merely states "It depends", lists multiple possible answer, and gives much less detail about each possible answer.

I also think that you can tell that this question is overly abstracted because the names given are unrealistic. You would (hopefully) never have actual code with a base class called Base and a field called _field1.

So:

If we see a question about a piece of code which is unrealistic and abstract, should we ask the asker to edit the question so that the code is realistic and concrete? Should we maybe even close the question as "unclear what you're asking" until the asker has edited it?

(Imagine if someone went to aviation.stackexchange.com and posted the following question:

Suppose I'm flying into an airport, and Air Traffic Control gives me an instruction. However, I look at the instrument panel and I notice that something unusual is happening. What should I do?

We'd certainly close it as unclear! Questions need to be specific about what is actually going on.)

9

IMHO it depends. Someone once told me, there is nothing so bad it cannot serve as a bad example, at least.

Take, for example, the question you were referring to in yours. I agree very much too you that this question cannot be answered in a "yes or no" manner for exactly the reasons you stated above. When I saw that question first, I voted to close as "too broad". I thought, answering such a question would require a long, broad essay about inheritance, class naming and polymorphisms, with several examples. I don't think, however, the "unclear" reason fits, since it is quite clear what the OP is after.

Nevertheless someone managed to gave a concise, not-too-bad answer without giving multiple possible example cases, only one. If the example given in that answer is really a good one and sufficient is debatable (as the discussion in the comments shows), but the total number of upvotes for the question and the answer shows the community received both well (which is not always a guarantee for a good answer, but a sign that a significant part of the community thinks the question & answer is ok).

So in short:

  • consider voting as "too broad", if you think the question deserves a book as an answer

  • telling the OP why you voted that way is a good idea, so giving him a chance to narrow down the focus

  • but consider also to retract the close vote when you see someone else found a different point of view for a reasonable, concise answer

6

If you think the question is unclear then vote or flag to close with the "unclear what you are asking" reason.

If you think the question can be salvaged, then leave a comment pointing out the problems and asking the poster to make the example more specific.

I don't think we need to go further than this.

You must log in to answer this question.

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