Take a look at What is "cache-friendly" code?.

Normally, I would consider this question not constructive and cast a close vote. It's a very broad question and it's asking for open-ended examples. I'm not the only one who had this reaction either -- there is 14-count upvoted comment saying exactly this, and the question has garnered 8 close votes so far (but of course that means it's also garnered 5 re-open votes).

However, after reading the accepted answer, I decided to take no voting action, since now I'm unsure. The answer is really excellent, one of the best answers I've seen on StackOverflow (terse and simple, yet very comprehensive, a difficult balance to achieve). The answer is so good it seems to tip the question itself into constructive territory, because it answers the question as if it were constructive (though some of the other answers are what you'd expect from a not constructive question). Does that make sense?

In summary: Should close votes be cast based solely on the content of the question in isolation, or should the question be considered along with its answers in deciding whether to cast a close vote?

As a side question, what do you think is the right action on this particular post (the previous close, then re-open, then heading towards closed again shows that there is definitely some community disagreement here).

  • 4
    The purpose of closing is not just to stop a question getting answers but to indicate to future visitors that the question is not acceptable. However, if the question has a great answer it should never be deleted... as that would be a waste of the content. As long as it remains closed and not deleted then the answer is still there to view. May 29 '13 at 19:06
  • 1
    Sounds like the definition of the reversal badge. Just take a look at the answers that got their posters awarded that badge.
    – Oded
    May 29 '13 at 19:07
  • 4
    Delete it, write a blog. May 29 '13 at 19:10
  • 3
    it answers the question as if it were constructive That would give the impression that a constructive question exists there somewhere, the person just didn't ask it. That would mean that you could edit the question into a constructive one that fits the (quality) answers given. It's perfectly appropriate to vote to close the question until such editing can take place (after all closing exists to allow questions to be improved).
    – Servy
    May 29 '13 at 19:11
  • 1
    Also note that the question requires an answer as long as the one you're referring to is a pretty clear indication that the question is "too broad". You could probably write a book on the subject, which is one of the tests to determine if a question is so broad that it's "not a real question". (And that's assuming the constructiveness issue is fixed entirely.)
    – Servy
    May 29 '13 at 19:14
  • I realise I'm new here, but IMHO the fact that the answer is "long" for SO (it is only 1300 words, so I don't feel it's the epic tome some are making it out to be) is because the question is about fundamental concepts, not necessarily because it is too broad. It is my suspicion that the question was closed largely because it first asked for examples -- a red flag for sure -- then set parameters on scope, as opposed to the other way around. The second line is the kernel of the question with the tags firmly limiting scope, the first line is just gaudy decoration. May 31 '13 at 12:54
  • @2manyprojects, not sure why people here are focusing on the length of the answer. To me, that's not even a factor when judging. That aside, I don't see how the scope is limited at all by the second line. "How can I make sure I write cache-efficient code?" -- same question. "What are the do's and don't's?" -- a request for this is nearly the definition of not constructive. "Any tips would be greatly appreciated." -- that's even less constructive than asking for examples. Only that tags "C++ cpu-cache performance" narrow it, but not by very much. C++ cpu-cache optimization is a huge topic.
    – Ben Lee
    May 31 '13 at 16:18

First, closing is a function of the question, and only the question. There are five reasons to close a question, and only five reasons to close a question. In this case, the question is not constructive.

The action of closing a question has no bearing on any answer, nor should it. The onus for fixing a closed question is on the person who asked it. Anyone else who improves it is doing so out of kindness.

I need to get that out of the way so there's no confusion on what I'm about to say.

Yes, this question should be closed.

No, this question should not be deleted.

Why? You don't delete questions with good content. That's not the same as closing a question. Closing says No more answers, please. It also makes a question eligible for deletion, but not all closed questions should be deleted.

In this particular case, there's a really good answer to a really bad [for Stack Overflow's format] question.

In fact, you could say it's not a real question because it is overly broad (as evidenced by the answer being nearly book length).

The close votes bear this out, and the community is right to want to close the question. I think this is a case (one of many cases), where people want to re-open a question because they're afraid it'll be deleted. I'd personally undelete this question, even if I believe it's not appropriate for Stack Overflow.

  • 5
    +1 for "No, this question should not be deleted." I won't speak for the constructiveness of the question, but at this point, it's been answered well. So let it stay.
    – Mysticial
    May 29 '13 at 19:13
  • Great! I'm actually happy with every part of this answer. I think my own hesitation to cast a close vote was exactly for the reason you guess that other people were re-opening -- fear of losing some great content. But as long as the question is not slated for deletion, I think I'm happiest with it remaining closed.
    – Ben Lee
    May 29 '13 at 19:22
  • 1
    @BenLee There are tools for 10K users to see questions with the most delete votes. It's up to the 10K+ users to make sure good content stays. If there are people who are voting to re-open because they're scared it'll get deleted, it means not enough people are manning the 10K review queues. May 29 '13 at 19:23
  • 2
    If you have an answer, post it. If you want to argue about the validity of an answer, post your own answer. If you're worried about life, the universe, and everything, then remember your towel, and don't panic. May 30 '13 at 0:51
  • @GeorgeStocker, was your lock on that post supposed to expire? It seems community unlocked it and removed the notice. Since then it has already been re-opened again. I cast a close vote, but even if it gets closed again, I doubt it will stay that way.
    – Ben Lee
    May 31 '13 at 16:22

No, a really good answer does not magically make a question constructive. There is still a problem with the question in that it invites other users to post pretty much anything as an answer, and we don't want that. That's why it should be closed.


A superb answer does not make a bad question into a good one. That's not what we really have here though.

What we really have here is a question that's much more focused and constructive than you realized. You initially perceived it as overly broad, and probably not constructive. That's simply a mistake on your part though. In reality, the question is fairly well focused and a good answer to it provides useful information.

IMO, much of what we have here is a bias (probably selection bias more than almost anything else) that (for one example) almost automatically assumes that virtually all optimization is really premature optimization. I believe this stems (at least primarily) from two points: most programmers write applications that have only fairly minimal performance demands.

I've long-since lost count of the number of times I've seen comments suggesting (possibly indirectly) that unless you've profiled code and found its performance problematic for your specific application, that you shouldn't care about optimization. While I certainly favor profiling (of code, anyway) this largely betrays an application-bias. If (for example) you're writing code for an operating system, compiler code generator, or library, your job isn't to ensure adequate performance of one application -- it's to ensure adequate performance for many applications (including those that haven't been written yet). Much like debugging can show the presence of bugs, but not their absence, profiling can show the presence of performance problems, but not their absence.

Likewise, some people routinely work in domains where performance really matters -- they can't afford to profile and optimize only the worst problem areas. They need to improve performance as much as possible everywhere to have even the slightest hope of a usable result1.

Even for those who don't truly need maximum performance, achieving it is often much more useful than most people realize (or are willing to believe). Many people prefer applications that feel "quick" or "snappy", even when/if they're not really necessary. Programmers (good ones, anyway) rarely write code to just meet the minimum requirements and move on. Code can be (and I will posit, should be) aesthetically pleasing -- and that should extend not only to the UI, but to the internal structure and yes, also to performance. Performance should be balanced with other goals -- not ignored.

The same background of many users on SO leads to another type of bias: the idea that "good" questions should usually admit to simple, concise answers. To an extent, this isn't unique to SO either -- the popularity of Twitter (for one example) shows the degree to which short, simple messages are (currently) perceived as good. While this is certainly true in some cases, it's not in others. It's also true that some questions (no matter how "good" they might be) require a longer answer than is reasonable to post on SO. Nonetheless, it appears to me that many have formed a somewhat warped sense of the reasonable limit on the length of an answer on SO (or at least the length that should be needed).

Ultimately, votes (up, down, or to close) on a question should be based on the question itself. That does not necessarily mean "the question in isolation" though -- when you see a great answer to a lousy question, that should make you stop and think a bit. Yes, that might really be correct, and the question really is lousy. There is another possibility though: when the answer is great and it really addresses the question (not just a great monologue prompted by, but not really responsive or related to the question) chances are that your perception of the question as lousy was mistaken.

That's the case here: the question isn't perfect by any means, and narrowing it somewhat would certainly be an improvement. Nonetheless, much (most?) of the negative perception stems more from bias on the part of the readers than from real shortcomings in the question itself.

  1. Yes, there are undoubtedly many times more who think they're in this situation than who really are -- that doesn't mean there are none who really are, nor does it mean we should automatically assume everybody is wrong when they think they are.
  • Not sure how your opinions on optimization are really relevant here. How useful people find the question has no bearing on whether or not it is considered "not constructive". As for the second part of your answer, I don't think the question is bad, and I never meant to imply it was bad. I actually think it's an awesome question. I just think it's "not constructive" according to SO terminology (admittedly poor terminology, glad they are revamping it). So this has nothing to do with a natural bias against questions that are open-ended--it's built directly into the StackOverflow policy.
    – Ben Lee
    May 29 '13 at 22:44
  • As far as the length of the answer goes, honestly I don't even think that's a very important factor. While a question that requires a very long answer is an indicator that it might be too broad of a question, it is by no means definitive. I have definitely seen a number of on-topic and specific questions that require relatively long and complex answers. What's important about the question is how well it follows established policy, not how long of an answer it requires.
    – Ben Lee
    May 29 '13 at 22:45
  • @BenLee: My opinions on optimization aren't relevant, nor can I see how you'd see that as the meaning of anything I wrote. In fact I said virtually nothing about optimization -- only about others' opinions of optimization, and the fact that there seems to be barely short of a spinal reflex to vote against (down and/or to close) virtually every question that involves the subject. While the question isn't as tightly focused as I'd consider ideal, it doesn't strike me as so open-ended that it qualifies as "not constructive". May 29 '13 at 22:58
  • 1
    I agree that that sort of off-the-cuff voting in regards to optimization is indeed a real pattern and can be problematic. Polarizing comments also tend to flow freely on such questions.
    – Ben Lee
    May 29 '13 at 23:13

I am quite surprised to see this question being discussed here, though I am happy to read various opinions on the subject! I'm the author of the popular answer and therefore I'd like to add my thoughts.

I can see why many people feel the question does not belong on SO due to being overly broad. I personally disagree for the following reasons:

  • The question covers a practical, answerable problem that is unique to the programming profession (cfr. SO FAQ).
  • The question was quite specific: examples of do's and don'ts in .
  • Cache-friendly is a major buzz word these days. Unfortunately, my personal experience has shown me that a large amount of people don't know what it actually means.

The question created an excellent opportunity to knit together some very popular related questions/answers (e.g. processing sorted array, order of loops, ...). In a sense I think this opportunity to link some concepts together may be of great help to less experienced programmers. I guess this is why many people considered the question to be overly broad. It's probably also why many people are fond of the answer. Obviously, the answer would not have been possible if the question was not asked.

George mentioned the question is overly broad (as evidenced by the answer being nearly book length). I would say that is nobody's fault but mine. I included quite a lot of extra information and general context (cfr. the entire preliminaries section). In retrospect it may have been better if I hadn't done that.

That said, I agree with George in saying that the question should be closed but not deleted.


Many posts, especially if they have a great answer, can be edited to be good questions.

SE benefits from good questions with great answers. Some people may feel it's "cheating" to edit a poor question to become a good question to fit an existing great answer.

It's also more work than closing or deleting questions.

You must log in to answer this question.

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