Conditional Sentences for Programmers ( and for You, too!)

This article was originally written as an internal memo for a software company I work for. A few developers have told me it's been helpful, so I thought I'd share it (with permission) with the Verbling community. Note to the grammarians: I've adopted my own terminology here and there. Yes, what I call "consequence clause" is really just a main clause. My aim is to emphasize the clause's function to English learners.

I've been seeing quite a few instances of faulty conditionals. Conditionals are used to express the relationship between an action and its consequences. They can be used to describe real and unreal situations. On the surface, conditionals may seem complicated, but we just need to know the rules. After that, it's pretty simple! Besides, I can think of no better audience for a post on conditionals than a bunch of programmers. I believe you are all already familiar with this relationship:

  • If ... then ...
There are four types of conditionals, each expressing a different degree of reality and probability. Every conditional is composed of two clauses: a conditional clause and its consequence.

My notation will be {conditional clause}, [consequence]

Zero conditionals


Zero conditionals express general truths. This relationship is always true.

>{If something melts,} [it turns from a solid to a liquid]
>[Pressure increases] {when temperature increases}
NB: if the main clause comes first, no comma is needed to separate clauses.

Form: Both the conditional and the main/consequence clauses are in the present tense. Notice, "if" and "when" are interchangeable here, because the consequence of a zero conditional is always true. It doesn't matter if or when it happens.

The First Conditional


The type-1 conditional refers to a possible condition and its probable result. Unlike the type-0 conditional, which refers to general circumstances, the type-1 conditional is used for particular situations.

>{ If you uncheck the box}, [the text will disappear].
>[You will begin receiving subscription emails] { if you sign up for a trial membership}.

Form: {if + subject + present simple}, [subject+ will +bare infinitive]

Notice, Only the consequence clause is in the future. I am frequently seeing this type of conditional written with both the consequent and the if-clause in the future tense.

>Your issues with lag will stop if you will install the upgrade.

Don't do that! {While this mistake is unlikely to cause a huge misunderstanding}, [it will definitely make you look like a non-native], as native speakers rarely make this error. It's like an unwanted foreign accent on the page.

>When you install the upgrade, your lag issues will stop.

The Second Conditional


The type-2 conditional refers to hypothetical situations and their probable results.
>{If they had the money} [they would invest more in development]
...but in reality they don't have the money
>[I wouldn't be so annoyed ]{ if I didn't have to rewrite the whole script}
...but in reality I do have to rewrite the whole script

Form {if + subject + past participle}, [subject+would+bare infinitive]
NB: The verb "to be" in the if-clause takes the form "were"

>If I were a rich man...

This is an important one for talking with clients about future projects. First of all, there will inevitably be hypothetical points to discuss--possible problems, potential results, et cetera. Second of all, the second conditional can be used to suggest politely. Let's say a client has a bad idea about how to fix a bug. {If you just told him},
"No, dummy, we have to redo the whole thing"
[you would probably look a little rude.] So, to avoid looking confrontational, you could deliver your suggestion to the realm of the hypothetical.

>{if I were you},[ I'd probably just rewrite the whole thing]
>[It'd be a bit easier]{if we rewrote the whole thing}

The Third Conditional


Finally, we have arrived at the type-3 conditional. Like the type-2, the type-3 is used to describe hypothetical situations and their imagined results. However, it describes an even greater degree of unreality, as it refers to the past. The type-3 describes hypothetical situations that didn't happen, and imagines what the result would have been.

>{If you had used our product}[you would have been notified on time]
>[I wouldn't have lost that client] {if i had payed more attention to his demands}-

Form: {If +s+ past perfect*} [s+would+have+past participle]
* the past perfect is formed with (s+had+past participle)

I sometimes teach this as the "regret clause". Look at the regrets implied in my examples, I wish you had used our product and I wish I had listened to the demands of the client.

I hope this may be of some help to the Verbling community! I'm sorry for any unusual formatting; {If I had known what a pain it would be to remove the original typographic characters peppered throughout the text,} [I probably wouldn't have written this article at all! ]
3 janvier 2019
Mi vida antes del Covid- 19 (IMPERFECTO) A-2
Profile Picture
Alejandra Santiago
7 août 2020
팔랑귀
Profile Picture
Abby H
7 août 2020
The Origins of popular English Idioms
Profile Picture
Jen Mc Monagle
7 août 2020