I see a lot of questions on SO where the user has an exception and asks how to solve it. Most of the time someone will point out the problem and quite often the root cause is a simple programming mistake.

For example, there are hundreds of questions where the OP asks how to solve a Java NullPointerException (currently 580 posts tagged with this and much more that have it only in the title). Eventhough the specific situation is always different, the solution usually is more or less the same (to first initialise this or that variable). It seems to me that these kind of questions are hardly relevant for future users. Not only do we get a lot of (more or less) duplicate questions, at the same time the solution is usually very specific to the code and not directly usable for others.

So, should we flag/vote-to-close questions on these types of simple programming mistakes that have been asked over and over?

And if we flag them, what should be the reason? "Doesn't belong here", "Exact Duplicate" (even if it isn't an exact duplicate)?


Answer summary:

The general opinion seems to be to at least answer the question. Possibly the only exception to this are errors that are so blatantly obvious, like missing a semicolon for example. Whether or not the question should be closed as "Too localized" after it has been answered is still a point of discussion. If we close these questions, then it will reduce the clutter on the site, but closing discourages people to improve the given answers.

  • 5
    If you close those it seems like a perfect fit for "Too Localized"
    – JNK
    Jun 30, 2011 at 13:08
  • Yeah, I was wondering about that one. I wasn't sure if "Too localized" only referred to questions relevant for users on a specific location/country or if it can be used in a broader sense. But now that I reread the description, I guess you are right.
    – THelper
    Jun 30, 2011 at 13:15
  • Can you please remove the follow up question? You should ask a new question (you can link back here and say it is a follow up).
    – user1228
    Jul 1, 2011 at 13:48

6 Answers 6


We get a lot of these in the SQL tags as well. The classic is "What's wrong with this query!?!?!"

My thought is to leave them, since they are all different in some way (hopefully), and each one may help a searcher find an answer better than another. Even though the root cause is the same, the specific syntax or programming mistake may be more relevant for some folks than others.

It also doesn't make sense to close them initially since:

  1. They aren't exact dupes

  2. They are on-topic otherwise

  3. They are probably clear enough to be understandable and have a code sample

  • 2
    4) It gives new users a chance to answer the more simple questions and gain rep?
    – THelper
    Jun 30, 2011 at 13:36
  • @Thelper - also a good point.
    – JNK
    Jun 30, 2011 at 13:37

I'd be wary of this. There are many people who encounter "common simple programming mistakes" who need help with them.

Last time I checked, StackOverflow was a website where people could ask for help with programming questions.

Of course, crap is crap and gets closed as crap. I wouldn't ignore helping someone just because they forgot to, for instance, include the line continuation token in their program.

  • 1
    +1 for Crap is crap and gets closed as crap.
    – JNK
    Jun 30, 2011 at 13:41
  • 3
    These kinds of questions are generally very localized. I close them without reservation, if the OP already accepted an answer.
    – user102937
    Jun 30, 2011 at 16:56
  • 1
    @RobertHarvey: I just don't see that. That only discourages further answers to the question. Yeah, that particular user now has their answer, but if I see that question and have encountered something like that before and have a better answer, that would mean it isn't too localized. But, since its closed, I can't provide a better solution...
    – user1228
    Jun 30, 2011 at 17:18
  • I'll give that some thought. But there are an infinite number of ways to ask "I need a regex that does [my highly localized thing]"
    – user102937
    Jun 30, 2011 at 17:48
  • @RobertHarvey: They need to open up that regex area51. In fact...
    – user1228
    Jun 30, 2011 at 19:05

I don't mind questions that refer to a specific exception, as long as that exception is somewhat useful to others who might find it.

However, I really dislike questions of the form:

What's wrong with this code?

var x = 3;
x += 1 
x -= 1;

Where the answer is "oops, you forgot a semicolon".

I fail to see how this question would ever help another programmer for the entirety of recorded history. It seems to me, to be a classic case for the too localized close reason:

too localized

This question is unlikely to ever help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet.

I generally delete these "missing semicolon" questions whenever I see them.


I think it's important to allow simple questions, because I think not allowing them would discourage question asking in general ("maybe my question is too simple? I don't want to get downvoted" would be a bad thing). Also, this is a site to ask programming questions - and being a beginner in something isn't a crime.

To look at it another way, I don't think that simple questions need necessarily be a general case to be of use to others - for example, I find browsing simple questions for an unfamiliar language/technology is a good way to get an overview of common gotchas.

  • +1 for "good way to get an overview of common gotchas"
    – THelper
    Jun 30, 2011 at 14:12

When someone write a question 'this code gets an NPE', it is too localized, I think, under the terms of the FAQ. No one is ever going to find it useful in Google.

Some times, that NPE results from a 'reusable' conceptual error. More often, it's just forgetting to initialize something.

If the question title were, 'Why do I get an NPE when I reference an uninitialized field', it would be a valid question. But that's not going to happen.

I tend to think that these questions should be answered and then closed as 'too localized'. Provides help to the original sufferer, then removes the clutter.

  • But closing it doesn't remove the clutter, since the question is still there and still shows up when you google the topic.
    – JNK
    Jun 30, 2011 at 17:50
  • 2
    @JNK: Closed questions are held for two days to see if they get reopened, and to show the OP what happened. After that, they are subject to deletion.
    – user102937
    Jun 30, 2011 at 18:39

There's something common to most of these questions:

  1. Exception in the title/tags
  2. Quite a lot of code in the question.
  3. Almost nothing else.

In most cases, in my experience, these are low quality question, asked almost exclusively by people who don't know how to debug code.

These question should usually be closed, though a link to an "how to debug" tutorial would be useful.

Related: How can we tell people that what they need is a debugger?

You must log in to answer this question.

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