1

There seem to be two types of questions people are closing as

This question was caused by a problem that can no longer be reproduced or a simple typographical error. etc...

The first type is code that has a typo(s), e.g.

int thisIsAnInt = 3;
tisIsAnInt = 4;

It should obviously be closed with that reason. The second type is when somebody makes a syntax error due to ignorance, not a typo, e.g.

int thisIsAnInt = 3
thisIsAnInt = 4

I know it isn't the best example, but there are useful syntax error questions, like this and this.

Should questions of the second type be closed solely due to them being syntax errors?

Note: To me, it makes sense to create a canonical question for every syntax error or type of syntax error. Then questions of the first type can either be closed as a duplicate or closed with the "a simple typographical error" reason, and questions of the second type can be closed as a duplicate, or if no duplicate exists, they can be turned into a canonical question.

2
  • 10
    As even a mediocre tutorial should manage to handle that on the first page, the question is not a good fit for SO and should be closed and removed expeditiously. The small-print of that close-reason fits: "While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." Oct 12, 2014 at 22:36
  • In reality, the scope of the issue is not the main futile issue at hand. Generally, we do not want this kind of behavior, but time and time again, it has show that the most effective technique in battling these types of issues are to simply reject them as ideas.
    – Ryan
    Oct 13, 2014 at 2:01

2 Answers 2

7

I know it isn't the best example, but there are useful syntax error questions, like this and this.

Right, both of those are useful examples. Your first one, with Python, is a major change between version 2 and version 3 that frankly not many programming languages would make. I myself asked that very same question when I upgraded from 2 to 3 (during the short period I used it). It's quite the "what the hell?" moment. That information, while technically a syntax error for Python 3, is very valuable information that also marks a major change between versions of a language, that many people will find useful throughout the future.

Your example here, with missing semicolons - not so much. Stack Overflow is for professional programming questions. It should be expected that you at least know the basics of the programming language you're using - most notably whether or not it requires the use of semicolons at the end of each statement. That is a very basic fundamental part of that language.

So no, they shouldn't be closed solely because it's a syntax error. Those parts of the close reason are bolded because they are key phrases meant to make the reason stand out as unique - to identify the essence of what the reason is about. In general, non-reproducible problems or typos are not at all useful to future visitors, but there are of course exceptions.

2

Personally, I generally define Typo questions by if:

  1. there is a solitary symbol/character (or very few characters) that is incorrect/missing

    if a == b) print a
    //       ^
    

  1. this is a face-palm worthy naming or valuing error (this may creep into "logical" mistakes instead of purely "syntactic" mistakes)

    The html form submits field named bar but OP is trying to access via $_REQUEST['foo']


  1. the OP needs a solution that is already demonstrated in their posted snippet(s); in other words, there isn't anything new to teach them -- they already know what to do, they just didn't do it

    Why isn't $escapedB actually being escaped?

    $escapedA = mysqli_escape_string($_POST['a']);
    $escapedB = $_POST['b'];
    

There will be other scenarios that qualify for what is off-topic typo, but the point of the closure is to trash questions that are not very likely to help future researchers.

My recommendation is that this closure should not be prioritized over nominating a duplicate (when a duplicate is also appropriate). This is because Typo is one of the closures that is least helpful to askers. It doesn't inherently offer any guidance about how to fix the bug and requires a comment to actually help the OP (which is the part of the audience that we are trying to support after all).

You must log in to answer this question.

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