comma before dependent clause [if, conjunction]: come with you, if


My teacher told me not to place a comman when the dependance clause is placed after the independance clause, but I found the following sentnece with comma in front of if. Is it right?

I’ll come with you to the hospital, if you want me to.
  • Where did you find that sentence?

    I’ll come with you to the hospital
    , if you want me to.
    differs a little from
    I’ll come with you to the hospital if you want me to.

    Say the first one and give a slight pause where the comma is.
    Your teacher is correct. You shouldn't put a comma before if. Whoever wrote the example may be trying to convey how the person is saying it, or it's just informal. But in formal writing, you shouldn't do it.
    It's grammatically correct with or without the comma but, as Paul says (post #2), there's a subtle difference with the pause indicated by the comma. I would say that it might suggest that the speaker is not sure that the other person would want the speaker's company for the visit to the hospital.