-2

I'm confusing with use of gerund or infinitive, I don't know which one of them I should use, for example ;

I'm looking for a function to reverse a string
I'm looking for a function for reversing a string

can someone tell me which one is correct and why ?

Thanks.

3
  • 4
    Why do you assume only one can be correct? That's usually the wrong way to bet, unless there's an ESL textbook in the woodpile. Both are in fact grammatical and colloquial, and both mean the same thing. The infinitive to reverse a string will be interpreted as a purpose infinitive, and the for with the gerund is the normal purpose marker. As usual, there is a choice, and people will vary, often from minute to minute, in which one they use in which context. Feb 20, 2021 at 21:29
  • 1
    Does this answer your question? How does one know when to use a gerund or an infinitive?
    – Laurel
    Feb 21, 2021 at 0:37
  • I'm looking for a function that reverses a string. They're all fine. And that's not to mention I'm looking for a string-reversing function. Feb 21, 2021 at 14:27

1 Answer 1

2

In a comment John Lawler wrote:

Why do you assume only one can be correct? That's usually the wrong way to bet, unless there's an ESL textbook in the woodpile. Both are in fact grammatical and colloquial, and both mean the same thing. The infinitive to reverse a string will be interpreted as a purpose infinitive, and the for with the gerund is the normal purpose marker. As usual, there is a choice, and people will vary, often from minute to minute, in which one they use in which context.

Not the answer you're looking for? Browse other questions tagged or ask your own question.