4

I'd guess as opposed to but I'm not sure.

This property must be set as opposed to X (one or another, not both)

How can this can be better?

6

You don't want as opposed to here: A as opposed to B means A (only), not B.

There are several ways of saying what you want; one may be more graceful than another in a particular context, but any of them will work:

Either [this property] must be set, or [property X], but not both.
You must set either [this property] or [property X], but not both.
You must set exactly one of [this property] and [property X].
Set one, but not both, of [this property] and [property X].
Select one property to set: [this property] or [property X].

3
  • 2
    "Either" already means "but not both". If your audience is literate enough, use just "either"; if not, use just "but not both". – MSalters Aug 30 '12 at 8:35
  • @MSalters I agree with you; but the Golden Rule for Writers is a corollary of Murphy's Law: If a passage can be misunderstood, it will be. – StoneyB on hiatus Aug 30 '12 at 11:38
3

I don't think "as opposed to" does what you want here. Instead of "one or the other, but not both," it means "this one, not that one."

How about: The property must be set as either X or Y. ("Either" suggests that the "or" isn't inclusive.)

3
  • +1 for "Either" implies that the "or" isn't inclusive – Miserable Variable Aug 30 '12 at 1:48
  • 1
    "Either" is suggestive of 'exclusive or', but only that. I certainly wouldn't say it does anything as strong as "implies". – Chan-Ho Suh Aug 30 '12 at 2:04
  • Edited to "suggests." – Kelly Tessena Keck Aug 30 '12 at 13:15
3

Properties X and Y are mutually exclusive.

2
  • Careful. The meaning doesn't match the original. The question refers to two distinct properties (with no mention of their values), not a single binary property. – quietmint Aug 30 '12 at 14:13
  • You are correct, I got caught up in some other interpretations here. I have corrected it. – Jim Aug 30 '12 at 14:31
2

X or Y must be set but not both

is short and unambiguous.

2
  • Careful. The meaning doesn't match the original. The question refers to two distinct properties (with no mention of their values), not a single binary property. – quietmint Aug 30 '12 at 14:13
  • I hold that it isn't the same at all. Compare "Your dessert may be ice cream or cake" (enumerating possible values for one property) with "You may have either an appetizer or a dessert" (separate properties that are mutually exclusive, with no mention of the possible values). – quietmint Aug 31 '12 at 1:12
0

If neither property is required, then consider phrasing it in the negative:

You may not set both [property X] and [property Y].

For clarity, also consider including the result of ignoring this requirement:

Attempting to set both properties will result in an IllegalStateException.

-or-

The most recently set property takes precedence.

0

If I understand your question correctly, "Set only one: A or B," would be clear and simple.

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.