0

in a recent question on SO, a user answered it correctly (using the right concept) but his answer had a few syntax errors. I would link to his answer but he has already deleted it.

Now, I'm wondering whether I should downvote this answer, or upvote it? I've seen people getting downvoted for syntax errors before, including me, but now I'm wondering what should I do.

His syntax error was something like (PHP)

echo "Hi, my name is $row['name']"; 

which is a very basic syntax error

8
  • 5
    Well, if the answer is incorrect, that's a very good reason to downvote it. But more importantly, comment on the post to notify the poster (and others reading the answer) of the error.
    – l4mpi
    Commented Oct 28, 2014 at 15:44
  • The answer was deleted after it got many downovtes. Also, me and the one who answered the question were in a heated discussion about why I downvoted him and now I'm wondering whether I did the right thing by downvoting him or not.
    – Ali
    Commented Oct 28, 2014 at 15:47
  • 2
    @FrédéricHamidi Yeah sorry, just realized my typo in my question and fixed it. I meant downvote the answer, not the question.
    – Ali
    Commented Oct 28, 2014 at 15:50
  • Well it's deleted, so its a moot point. Obviously you can't downvote it unless it is undeleted.
    – Servy
    Commented Oct 28, 2014 at 15:52
  • 3
    I cant say how bad your example is, but who hasnt had a typo or two in the answer? If the answer is so bad it reflects no grasp of the basics, then ok DV. If it is minor - an actual typo - it might be better to leave a comment, give them time to repair it. Then DV if they do not (or remove DV, but that gives the impression it is way off base to others which may not be so if it is a typo). Case in point: should we DV your post because of your typo? Commented Oct 28, 2014 at 15:52
  • 1
  • @Servy Yes, I had asked that on meta.stackexchange and I was advised to ask it here instead.
    – Ali
    Commented Oct 28, 2014 at 15:59
  • @Ali You already have an answer, there is consensus on it, the question is open, I'm not seeing a reason to re-ask it.
    – Servy
    Commented Oct 28, 2014 at 16:01

1 Answer 1

3

No, do not downvote, just edit it.

2
  • 6
    In the general case, be very careful when editing code in answers. You have to be absolutely sure there actually is a syntax error, and it should be a pretty simple one (e.g. you should not have to modify ten lines of code because of it). Otherwise, fall back to commenting. Commented Oct 28, 2014 at 16:17
  • 6
    By the way, I fixed the simple typo in your answer. Commented Oct 28, 2014 at 16:18

You must log in to answer this question.

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