15

As an example, I would like to use this staging ground question which is available on the main site here.

The staging ground question initially included a code snippet that produced the required output. Since I could not reproduce the error mentioned in the post, I selected "Major changes required" and recommended the inclusion of a minimal reproducible example.

The OP amended the post, and it became clear that there was an obvious syntax error (a statement in the wrong context, in the body of a class). I chose to suggest fixes in a comment and explained that in my opinion the question cannot be further improved to make it suitable for publishing on the main site since the title and most of the details provided had little to do with the actual error message.

The OP thanked for the fix and expressed something along the lines of "sorry for the noise".

I was not sure what do next. I could have:

  • Declined re-evaluation, which seemed unfair since the OP did what was recommended.
  • Voted the question off-topic.

To my surprise, another reviewer deemed the question OK and it eventually ended up on the main site. I still think that the question is not particularly useful.

What would have been a better way to handle the review of such questions where the title and the details provided have little or nothing to do with the actual problem?

7
  • 2
    I'd say although that question could be considered a typo it very well could be something beginners in the language misunderstand. Also I'd say the error given in this case is also somewhat unhelpful so having a Q&A to address this could be useful. Commented Nov 4 at 10:45
  • @AbdulAzizBarkat, since it was a whole line of code, I personally would not have considered the error to be caused by a typo. "A Q&A to address this could be useful": In that case, should the title include the error message? The initial question was about adding a function to a list of functions. Is it reasonable to expect the user to amend the title and effectively ask a different question?
    – Dan R
    Commented Nov 5 at 3:45
  • 3
    If you don't think its a typo, it's on-topic, has an MRE, is clear enough, you can't find a duplicate and you don't think there's anything else to improve, shouldn't you be approving it then? You can improve the question if you feel up to it by making the title / body more relevant. Commented Nov 5 at 7:59
  • 1
    I found these three questions where people had the same issue: 1, 2, 3. It does seem like these aren't easily searchable so some edit might be needed. Commented Nov 5 at 8:11
  • I think this question could maybe use a new title; there's a difference between "how should we deal with syntax errors" (in general) and "how should we deal with this syntax error."
    – Anerdw
    Commented Nov 6 at 2:44
  • 1
    @Anerdw, I can see your point. My intent was to ask a more general question. I have amended the question body to make that clearer.
    – Dan R
    Commented Nov 6 at 5:51
  • General questions tend to not do very well on meta, the devil is always in the details. I would really keep them as specific as possible if I were you. If it really can be answered generally, the answer is probably already in the FAQ.
    – Gimby
    Commented Nov 6 at 14:26

2 Answers 2

22

A syntax error is not necessarily a typo

Many of the most useful questions have revolved around "simple" syntax errors that follow a common pattern. Beginners in the language make the same mistake all the time, and they sincerely expect the code to be meaningful and have a specific meaning that it just doesn't because of the rules of that language.

For example, Python programmers might not realize that a block can't be empty; or be surprised that their mis-indented else doesn't register as an IndentationError but instead gives the wrong behaviour, because it aligned with a loop instead (a feature seen in few if any other languages); or (prior to 3.10) get a misleading IndentationError because a try: was missing the corresponding except:; or simply expect a tab to equal a specific number of spaces (which changed in 3.x); or not realize that docstrings have to be indented like normal code (because they're not actually comments). Even if they don't know the absolute basics, it's worth having an explanation.

Similarly for the problem described here: it's very easy to imagine a programmer sincerely expecting the code to work, and having written it entirely deliberately. The intended purpose is clear. Something is learned by pointing out that a different approach is necessary; and simply having someone point to the erroneous line doesn't empower OP to fix the problem. That is: the question isn't really a "debugging" question; it's a how-to question in disguise.

For that matter, code that appears directly within a class body (not within a method) would work in Python. New Dart programmers might very reasonably have the expectation that OP's code should cause the filters to include _myFunction for each instance. Showing how to make the constructor do this instead is useful. (In fact, Python programmers applying Python's rules would expect filters to be shared between instances of the class, and to be initialized to contain _myFunction before any instances are created.)

The question should be edited

While the code might all be necessary to demonstrate what OP is trying to do, it isn't all relevant to the problem reported. The code is not expected or required to reflect the real-world problem OP is trying to solve - because OP is not required to be trying to solve a real-world problem, but only to ask a practical question.

A Minimal Reproducible Example needs to be minimal - so the code should only show the relevant class, not a complete program. (It also shouldn't be necessary to define a separate LogEntry class to demonstrate the problem; why not just use a primitive type?)

However, I have refrained from editing because I basically don't know anything about this language.

The question may be a duplicate

The problem described sounds like something that should be very common. Surely new Dart/Flutter programmers try to write top-level code in a class all the time (since, again, there are other languages where this is well defined and meaningful). A search like [flutter] the name of a constructor gives me over 100 results - none of which really stands out as a well-asked question, and many of which are surely about other problems; but that's a starting point.

There should be a canonical duplicate for that problem. If one cannot be identified by the Dart/Flutter community, this could become one.

1
  • 1
    Your answer is comprehensive and most importantly mentions the term canonical duplicate. I was not aware of the concept of canonical question/answer/duplicate and I suspect that may be the case with many users that are new to the reviewing process.
    – Dan R
    Commented Nov 6 at 8:58
1

The step-by-step guide below is meant for newcomers to the reviewing process and aims to summarize the guidance provided by the comments and the answer of Karl Knechtel.


When reviewing a staging-ground question and the reported problem is caused by an obvious syntax error and has little/nothing to do with the actual question and the details provided, consider the following steps:

  1. If the syntax error is a typo, vote to close as not reproducible or caused by a typo. Some common typos may have a canonical Q&A on the site. In that case, it makes sense to vote to close as a duplicate.
  2. If the syntax error is not a typo, avoid using a comment to answer the question. Instead, see point 3.
  3. Search for duplicate questions mentioning the error/problem. If such duplicate exists, vote to close as a duplicate. If not, see point 4.
  4. The question should be edited. Remember, step-wise instructions are easier to follow.
    • Request the inclusion of a truly minimal reproducing example. The OP will most likely need some guidance.
    • Request that non-relevant details be removed/minimized.
    • If required, request a change of the question title, making sure that the question can be easily found by others facing the same issue.
  5. After successful re-evaluation, approve the question.
  6. If the same problem is mentioned in many (seemingly unrelated) questions, consider identifying a canonical Q&A.
5
  • 1
    "Request the inclusion of a truly minimal reproducing example" note that if you feel that you can make the MRE yourself feel free to go ahead and edit the question yourself as long as you feel you've not changed the core issue in the question. Commented Nov 7 at 7:11
  • 1
    Re: 1. - some typos have canonicals on the site because they are encountered often. For example What is the difference between the = and == operators and what is ===? (Single, double, and triple equals) which is linked when the code is using an assignment instead of equality (e.g. if (x = true) instead of if (x == true)). This is a very common mistake because the assignment operator is misleading and looks like an equality check (like one you'd use in maths).
    – VLAZ
    Commented Nov 7 at 7:14
  • Regarding changing the title: In many cases, it might be easier/faster to change the title by yourself (as the reviewer) as opposed to asking the author to do that.
    – dan1st
    Commented Nov 7 at 9:43
  • @AbdulAzizBarkat, dan1st, as a low rep user I am rather inclined to suggest changes to a question. The staging-ground reviewer guidelines do mention "Feel free to make edits to a post to help move it along". To me, this instruction is not quite clear. Is editing, in general, not limited to fixing spelling mistakes, formatting code, etc, without changing the meaning of the post?
    – Dan R
    Commented Nov 7 at 11:34
  • If your purpose is making a canonical, its quite possible that the asker themselves is not the best person to do that, some times the community either edits an existing question to make it suitable to be a canonical or post a canonical themselves. Editing a question to simplify the language, improve the title or reduce the noise either in the question or in the code is totally fine as long as the actual meaning of the question is preserved. Commented Nov 7 at 11:53

You must log in to answer this question.

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