4

I recently asked a question which had a typo in it. Mainly because I had my Stack Overflow account only on my mobile and it is actually "complicated" to write code there. The question was asking why Tibco Spotfire is complaining that the function AllPrevious is not available. The following code

 sum([cost]) OVER (AllPrevious[Axis.X])

was included in the question. The code had an obvious typo, namely it should have been AllPrevious([Axis.X]). However, this is (IMHO obviously) not related to the problem. Somebody pointed that out in an answer and even got an up vote. If he would have tried it out he could have matched it based on the error message. So I pointed this out in a comment:

While you have a point that my stmt was incorrect it can not explain the error and also gives a completely different error message your answer should rather have been a (valuable) comment.

I was expecting him to delete the answer and place a comment, which would have allowed me to fix the question, without rendering his answer useless.

However, I got only some offending answer:

I'll be sure to skip your questions next time.

I was wondering what is the right way to deal with such answers which obviously miss the point of the question.

3
  • 1
    I downvote such useless answers.
    – Kevin B
    Commented Jun 16, 2016 at 20:46
  • 2
    I don't see the excuse of "only on my mobile" as a good reason for not proofreading your questions before posting. If you can't do a good job of asking a question on your current device, wait until you can get to a device which allows you to do so, before asking the question. Commented Jun 16, 2016 at 21:00
  • 1
    Its up to you to make sure your question is as good as it possibly can be. If it has obvious typos, then it is fair that anyone reading it thinks that your code has the same obvious typos. In which case you would get a down vote and a close vote for "a simple typographic error".
    – JK.
    Commented Jun 16, 2016 at 21:55

4 Answers 4

12

When someone points out a typo in code I have in a question or an answer -- which is quite rare, because I usually copy and paste my code from an editor that checks my syntax -- the first thing I do is apologize for the presence of the typo because it means that I cut corners. Typos can send people down the wrong path and waste the time of readers, so apologies are warranted. If someone posts an answer that merely points out a typo in my code, that's not the brightest thing to do on their part, but I'm still the one who managed to post the typo in the first place so I'm the one responsible for the mess. It really does not matter how obvious the typo is. I also thank the person who notified me of the typo because without their help more time could have been wasted.

Once the typo is fixed though, the answer is useless so I vote accordingly.

2
  • +1 for the acknowledgement of culpability and wasted time. Commented Jun 16, 2016 at 21:05
  • usually it's still better to notify the typo in a comment, because more than 66% of the time, the typo was just done when rewriting the existing code to a shorter, reproductible example. So i don't post typo as an answer.
    – Walfrat
    Commented Jun 17, 2016 at 7:36
4

I'm not sure how else you could have kept that answer valid, since it was an off-the-cuff syntax response to a problem which didn't entirely warrant it. Personally, I wouldn't have felt bad about revising my question with some additional details to explain why the typo masks the actual problem.

That'd what I would recommend in the future - if someone does make an answer who is focused solely on the typo, but the typo is in and of itself not the answer, downvote it and leave a clarifying edit in your question.

2

There are three possibilities:

  1. The typo is a side-issue, the question should be fixed.
    Thus, the answer should at most have been a short-lived comment.

  2. The typo is the reason for the question, in which case it should have been closed as a simple typographical error.
    Again, the answer is useless and should at most have been a comment.

  3. You are mistaken, and it's not actually a typo.

Useless answers should be downvoted, as the tooltip states.
And there is a dedicated flag for cleaning up non-answers.

1

Well, a lot of problems we see on Stack Overflow are actually caused by obvious typos in the code. There is even a standard close reason for them:

This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers...

(emphasis mine). So don't be offended if somebody points out a typo in your code, be it in an answer or a comment. Just point out that they're wrong (like you did) - the answer has been deleted in the meantime.

You must log in to answer this question.

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