3

I've encountered some users who have used outdated sample code in their posts. Specifically these are PHP code blocks but are written in old php version, for example instead of using mysqli_fetch_array the user uses mysql_fetch_array and so on.

The question is, how to deal with those users? Should I:

  1. Answer them directly to the question. (this will encourage them to use an outdated code which in long run will not benefit them)
  2. Encourage them to use the updated code (this will confuse some of them, but benefit them in the long run)
  3. Answer their question and encourage them to use an updated code. (Whenever I do this some users just ignore my answer, and some even considered my answer as not helpful)
2
  • Just to be clear—is the code sample you're talking about in a question or an answer? Jun 19, 2014 at 7:58
  • Oh. I'll edit my question later. They are in a question. Jun 19, 2014 at 8:00

1 Answer 1

5

Answer the question, and point out that they are using outdated code.

If you don't have an answer to the question, stick to a comment.

People don't always choose to use outdated code; sometimes they are stuck with a legacy codebase and compatibility issues.

Still, you should warn both the OP and future visitors when there are serious issues with their code beyond the original question. So do warn them about these issues and explain how to fix them.
Whether they take your advice or not is up to them.

2
  • 2
    I agree with this, I just want to make it clear that you have to actually answer the question, not just point out they are using outdated code. If you do that in an answer, great. If updating that code fixes the problem, even better. Jun 19, 2014 at 8:33
  • Right. You have a point there buddy, thanks! Jun 19, 2014 at 23:51

You must log in to answer this question.

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