1

What's the difference between these two sentences

When the user runs the program or file, the malicious payload of the Trojan is injected into the system

If the user runs the program or file, the malicious payload of the Trojan is injected into the system

Which is a native speaker more likely to use? What is different about their meanings or implications?

2

Do you think a user will run the program? If you think "yes, they will" then use "When". If you think it is possible but you are not sure, the use "if".

When Jack comes home, I will give him this present. (I know Jack will come home)

If Jack comes home, I will give him this present. (It is possible that Jack won't come home)

In many cases, there is little difference. You might think "Yes, someone will run the program eventually, but probably not soon" and so both "when" and "if" sound normal and natural.

-1

if is a conjunction It is used to express conditions or suppositions.

when is an adverb It is used to express that something happens, happened, or is happening at some point in time.

4
  • I have downvoted your answer because the second part is incorrect - or, at best, only partially correct. Check it out: partofspeech.org/what-part-of-speech-is-when Jul 27 at 23:56
  • If my answer is incorrect, you are saying that that when is not adverb. In this case, my answer is correct, but it is incomplete.
    – Pin90
    Jul 28 at 0:48
  • As the grammar source points out, the function of when depends on how it is used. It can act as any of several parts of speech. In the examples above, the words if and when serve identical functions as conjunctions connecting the two clauses. Jul 28 at 7:33
  • Totally agree with your point
    – Pin90
    Jul 28 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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