bell notificationshomepageloginNewPostedit profile

Topic : When vs. If vs. In situation where An excerpt from Microsoft Writing Style Guide, which I'm trying to follow: Use if to express a condition, use whether to express uncertainty, and use when - selfpublishingguru.com

10.01% popularity

An excerpt from Microsoft Writing Style Guide, which I'm trying to follow:

Use if to express a condition, use whether to express uncertainty, and use when for situations that require preparation or to denote the passage of time. Examples:

If you don't know whether a network key is needed, contact your network administrator.
Use your BitLocker recovery key to sign in if you're locked out of your computer after too many failed password attempts.
When Setup is complete, restart your computer.
To find out whether TrueType fonts are available ….
Save a webpage to view it later, even if you're not connected to the internet.
docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/i/if-vs-whether-vs-when
Here is an old version of my text; the version that I have written before trying to follow Microsoft recommendations:

When you need key–value pairs, use associative arrays.
Otherwise, use simple ones.

According to Microsoft recommendations, I changed it to

If you need key–value pairs, use associative arrays.
Otherwise, use simple ones.

But now it doesn't look syntactically correct to me. The problem is that I think that "if" must not be followed by a plural form. (My primary language is different from English.)
Here is the solution I came to, though I'm not sure it is really good or even correct:

In situations where you need key–value pairs, use associative arrays.
Otherwise, use simple ones.

How would you resolve such an issue? Is my solution good?
edit. Here is how simple and associative arrays look:
SimpleArray = ["Value1", "Value2", "Value3"]

AssociativeArray = ["Key1": "Value1", "Key2": "Value2", "Key3": "Value3"]


Load Full (1)

Login to follow topic

More posts by @Mendez196

1 Comments

Sorted by latest first Latest Oldest Best

10% popularity

The sentence construction starting with 'if' is correct, both per the style guide and the conventions of 'natural' English. Bullet point #2 shows why. 'Otherwise' implies an alternative course of action is possible, i.e. the first bullet point expresses a condition. Your solution communicates the same information to the reader and is also correct.
In 'natural' English, 'when' sets an expectation considered inevitable:

And when they use our atoms to make new lives, they won't just be able to take one, they'll have to take two, one of you and one of me, we'll be joined so tight...

The taking of atoms to form new lives isn't optional. It will happen at some unspecified point in the future. Ergo, 'when' is used.
In your example, if the user has no other choice than to use key-value pairs, you'd start the sentence with 'when' (and you'd also cut the second bullet point.)


Load Full (0)

Back to top