Here is a passage in a technical document I'm working on:

Simple vs. associative arrays

  • Where you need key-value pairs, use associative arrays.
  • Otherwise, use the simple ones.

As I felt, there was something wrong with "where + otherwise" pair, and as FumbleFingers confirmed in the first comment, this feeling was correct: this pair doesn't really work well.

One way to workaround this issue is to use "if" instead of "where". Though it will fix the passage posted above, I cannot say that I really can use this solution. This is because that document has other similar passages that uses "where you need", "where possible", or "where necessary", and I want to use the same word ("where" or "if") for all of them. Unfortunately, some of them (maybe I'm wrong!) don't accept "if". For example:

Case-sensitive equality operator

  • With regular strings, use it only where necessary.
  • With the empty string and numbers, use it on every occasion.

"On every occasion" points to a location or maybe time, and thus using "if + on every location" looks somewhat asymmetric to me.

And another reason that I don't want to replace all my "where"-s with "if"-s is that "if" creates some ambiguity. I would reserve it for passages like this one:

  • If you think you are really skilled, feel free to use the ternary operator.
  • If you don't think so, don't use it.

How to rephrase the first passage without replacing "where" to something different?

  • 1
    I think it would be much better to use if instead of where. Then the possible "semantic clash" between (metaphoric locational) where and (metaphoric methodological) otherwise wouldn't arise anyway. Not everyone would even recognise that "clash", but I'm guessing the reason for asking this question in the first place is that even some non-native speakers can sense something "odd" about the juxtaposition Where / Otherwise. And I suggest it would be positively "weird" in the cited context to go with the "regular" pairings Where / Elsewhere. – FumbleFingers Jun 18 '20 at 13:07
  • 2
    Since this appears to be about programming, I might also suggest going for the familiar programming combo if / else (if). – JMB Jun 18 '20 at 13:47
  • 1
    Don't overthink this one! It's true I said there's a possible clash between where and otherwise. You yourself have misgivings, or you wouldn't be asking here in the first place. And I too sense something slightly "awkward" there, but I doubt many other native speakers would feel the same. I suggested switching where to if because if is far more common in such contexts AND because it would make your problem "disappear"! But you seem determined to hang on to where even if this presents you with significant difficulties! – FumbleFingers Jun 19 '20 at 12:10
  • 1
    ...but note that etymologically speaking, adverbial otherwise is contracted from Old English phrase on oðre wisan "in the other manner". So metaphorically speaking you're juxtaposition / contrasting where (some location) and otherwise (some method or manner) - which isn't exactly "like for like". Hence you might think that if you're going to start with where [place A], you might more "consistently" contrast that with something more "locational", such as on the other hand. – FumbleFingers Jun 19 '20 at 12:14
  • 1
    I'm not sure how useful your "answer" is. My advice was to ditch locational (displacement in space) where in favour of straightforward if, but all I see is you moving sideways to temporal (displacement in time) when. Which obviously you can elegantly "pair" with things like on other occasions, now and then, from time to time, but I can't see that truly resolves the issue. I have to say I'd be interested to know how it comes about that your existing text has many instances of when that you say "cannot be replaced with if". – FumbleFingers Jun 19 '20 at 15:14

As a developer (currently not visible on SO as yet - though that's where I started reading along on Stackexchange back then), I think

there is perfectly nothing wrong here with "where... otherwise".

These are well-established ways of expressing circumstance in a problem (or more exactly, properties) akin to mathematics where "where..." is what to use to describe properties of an element in a problem and "... otherwise" may be used to denote "all other cases" after some have been described.

As already pointed out in great detail in this answer, there is obviously nothing wrong with this grammatically either.

The same would hold from a purely pragmatical point of view - such as to make oneself understood in exactly the way that would be on point and expected for the reader to get an unambiguous grasp of what they are being taught. In development (and mathematics), it's perfectly customary to use exactly this wording.

Although I'll add that my feeling with where you need is slightly off the track beaten by mathematic usage as that would be more strictly describing properties of parts of a problem rather than conclusions such as an implementation detail commanded by an ongoing design decision. But that seems to me a very minor difference in this case and does not command a change at any rate.

So the wording already present would be as close to perfect as it can get unless a completely different avenue were to be taken to describe the facts (and what would that be?).

The wording as is is perfectly correct in the field of software development - to go deeper, which I don't think is necessary, a look at vocational language could provide additional insight.

As an extra precaution, though rather not language-wise, the passage in question might stand a check on Stackoverflow or Software Engineering, because there is something that feels slightly off (although Javascript is not exactly one of my first batch of languages) about the second line and I'm not perfectly sure of what it is. That one, though, could be just oversensitive gut feeling on the language tier on my part anyway, then leaving the factual point unchallenged.

To go still deeper, a check for slight variation in register could be made, but again, of course depending on what is being aimed for, I wouldn't overdo it already having a perfectly suitable expression.

As for uniformity as a goal with respect to the other examples, experience from reading lengthy formal documents (where uniformity in clauses is sometimes required) shows that it can contribute rather negatively to the ability of the reader to keep their attention focused on their read. So it seems preferable to rather avoid perfect uniformity where not required because of sound reasons.

Stereotypical expression in a formal description of e.g. requirements may help the reader as they would be reading from a different angle - scarcely looking at the sterotyped parts of the text at all - as they are not learning but instead going through a (semantically) rather checklist type of document.

The ifs in the last example passage are perfect, too - that's a different kind of differentiation, so they are perfectly where they belong.

  • Yes, if there is awkwardness here, it is in the choice of active voice and pronoun you. I would rewrite any of several ways, preserving where but getting rid of you."Use associative arrays where key-value pairs are needed." Shifting the where phrase closer to otherwise helps with parsing, and passive voice is being begged for here. – Phil Sweet Jun 21 '20 at 14:13
  • @PhilSweet thank you for your edit request driving towards perfection in answers. Not sure if the edit I made actually satisfies that but I tried. As a matter of style, I don't know how to go any further here about active voice though - if you rather had something more edited, I welcome your additional guidance or fixing any issues I have missed directly. – somebody_other Jun 21 '20 at 15:23
  • @PhilSweet I use active voice and place "where" in the beginning because of Google style guide: developers.google.com/style/clause-order. Though probably it is the case where it's better to step sideways. – john c. j. Jun 21 '20 at 20:20
  • [perfectly nothing wrong] – Lambie Jun 24 '20 at 21:41

I frankly don't understand why otherwise cannot be used along with where.

The online Oxford Dictionary defines otherwise as:

In circumstances different from those present or considered; or else.

Since where in the OP's examples can be easily construed as denoting circumstances (as opposed to places), the use of otherwise along with where is not unnatural at all.

Replacing where with when would be unnecessary unless you want to emphasize the temporal nature of the circumstances, which isn't clear from the examples.

  • "In circumstances different .." is metaphoric locational ("in" being locative), just as "Where" is, so I agree with you that there isn't a semantic clash. – auspicious99 Jun 21 '20 at 10:53
  • It's fine, yes. Everyone seems to get their knickers in a twist over nothing at all. I think that many people in these fora are simply not writers....and to give it a huge bounty and move it from the ELL site. Too much, really. – Lambie Jun 24 '20 at 21:40

The problem with where is that the customary alternative to where ... is elsewhere .... So if you want to keep where, you're left with two choices:

  1. Use elsewhere, which doesn't work quite as well as otherwise for this metaphorical use of where.
  2. Use otherwise, which isn't that bad an alternative; it may sound slightly wrong to some ears, but judging from the answers and comments, most people would skip right over it.

I think both of these choices are perfectly reasonable—use whichever one sounds best to you.

  • 3
    It's a fascinating twinning of a metaphorical and a literal usage. Non-identical twins. But I wonder how many people recognise that 'where' = 'in those cases ...' actually is a metaphor? I'd say it's dead, whereas metaphorical 'elsewhere' might raise the odd eyebrow. Counting numbers of raised eyebrows, I'd go with 'otherwise'. // 'When' is possibly even deader. – Edwin Ashworth Jun 21 '20 at 15:28

I probably exclude myself from the bounty by saying that the question is based upon a misunderstanding and thus that the problem does not exist.

Where you need key-value pairs, use associative arrays. ' / Otherwise, use the simple ones.

You: As I felt, there was something wrong with "where + otherwise" pair, and as FumbleFingers confirmed in the first comment, this feeling was correct: this pair doesn't really work well.

Fumble Fingers: I think it would be much better to use if instead of where. Then the possible "semantic clash" between (metaphoric locational) where and (metaphoric methodological) otherwise wouldn't arise anyway.

I can't agree. There is no clash. "Otherwise" is not restricted to a methodological meaning; it is also locative. = in other circumstances. (The preposition "in" is locative = within; inside.)

Circumstances are a location and that is why we can say "Where you need key-value pairs, use associative arrays. ' / Otherwise/in other circumstances, use the simple ones.



  1. In another case; in other circumstances;

1726 J. Swift Gulliver II. iii. x. 143 By this Defect they are deprived of the only Entertainment whereof they might otherwise be capable.

1952 B. Pym Excellent Women ii. 14 Women did not tend to fuss over him as they might otherwise have done. 1988 in R. Dinnage One to One 145 I'm very glad someone gave me the push to do that. I might not have done it otherwise.

Thus, the pairing works perfectly, and "where otherwise" is very common (although a little formal). See also Google Ngram at “where otherwise”

  • 1
    "I probably exclude myself from the bounty" No, I'm open to different opinions. – john c. j. Jun 21 '20 at 10:22

As has already been pointed out on this page, there is nothing really wrong with the where/otherwise pairing, so one doesn't have to change it. But if one is bothered by it, and really wants to avoid otherwise (while keeping where), it may be helpful to note that 'Where you need key-value pairs . . .' means the same as 'in the cases in which you need key-value pairs . . .'. This can lead one to:

  • Where you need key-value pairs, use associative arrays.
  • In all other cases, use the simple ones.

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.