1

Using this question as example for my question.

This question is basically asking for a correction to a regular expression to add quotes around an unquoted array identifier and gives an example.

A user posted a (now deleted) answer, which only solved the outlined example (replacing name with 'name') and did not solve the general problem. (At least in the revision I last noticed. It's now deleted and I'm below 10k rep so I can't see if it was improved before it was deleted.)

The answer was also unlikely to point the user to a working solution as it can be assumed from the question that he does not know which strings need to be replaced before the script is run.

I downvoted that answer and upvoted (later) the answer that should actually solve the problem (which is also accepted now) and flagged the first answer as not an answer. However, that flag got disputed.

Was I right in flagging and downvoting that answer or was it considered an acceptable answer?

2
  • 1
    Your downvote was correct, your flag not. The post tries to answer. NAA flags are for answers that only provide a link or for totally wrong posts, new questions or thank you posts.
    – rene
    Jun 22, 2014 at 14:47
  • This just happened here as well: stackoverflow.com/a/24352668 Jun 22, 2014 at 15:24

1 Answer 1

4

They may not be ideal answers, but they are answers nonetheless. If you think an answer doesn't address the general situation, and would only work for a particular case, you can either:

  1. Downvote the answer and move on.
  2. Downvote the answer, and leave a comment stating why you downvoted, and what could be done to improve the answer.

I usually go with #2 if I think the answer is otherwise good, and has a chance of being improved. Sometimes, these answers are far from salvagable — in such cases, I just downvote and move on.

In this case, it was pretty clear from the question itself that the OP wanted to replace all the occurrences of unquoted key names, and not just $_REQUEST[name]. The person who answered the question probably overlooked the fact, and answered the question.

You were right to downvote it, as it didn't answer the question very well. His regex wouldn't have worked for cases other than $_REQUEST[name], so the downvote was perfectly alright. However, your flag was not appropriate.

From How do I properly use the "Not an Answer" flag?:

When should I use this flag?

Use this flag when an answer is being used to:

  • Ask a question
  • Communicate with another user
  • Say "thanks," or confirm that another posted answer worked for him.
  • "Bump" the question, as in "I have the same problem, have you found a solution?"

In this case, it was still an attempt to answer the question, no matter how bad the answer was. It shouldn't have been flagged.

You must log in to answer this question.

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