IS OR EVER NEEDED?

The tip: “Don’t mix your ANDs and ORs” has been a staple of programming tutorials for decades now, and it’s still as relevant as ever. It also applies to writers of natural language. Here is an example of that fatal mix of and and or that causes ambiguity:

A driver must have a valid driving license and be 23 years of age or have 2 years of driving experience.

This could mean:

A driver must (1) have a valid driving license and be 23 years of age, or (2) have 2 years of driving experience,

but it could just as well mean something very different:

A driver must (1) have a valid driving license, and (2) be 23 years of age or have 2 years of driving experience.

In technical programming languages, of course, you must learn how to be precise about the scope of the AND and OR operators in your code, but in this blog, I want to talk about the natural-language format. A colleague recently told me that one of her customers had decided to get around any ambiguity by giving this simple instruction: “don’t write OR – it can cause ambiguity and it is never really needed”.

This is a spectacularly clear instruction. It does away with the entire issue: a combination of ANDs that are never mixed with ORs is always unambiguous.

But before we ban poor OR from our writings altogether, let’s look at it from the opposite end. Or is a perfectly natural, popular, frequent little word. Writers of English-language business rules come up with it all the time. So are we not missing a point? Does or really have nothing to offer?

Imagine you have a rule that says:

A person may only be registered as a driver if that person is over 22 years of age or has held a driving license for more than 2 years without interruption.

Or expresses that either of the 2 conditions that it connects is by itself sufficient for a person to be registered as a driver. Writing and in place of or would have meant that both conditions are necessary for a person to be registered as a driver.

You could drop or by splitting this statement into 2 separate rules:

A person may be registered as a driver if that person is over 22 years of age.

A person may be registered as a driver if that person has held a driving license for more than 2 years without interruption.

These two rules together express the same logic. The biggest difference is that they are 2 separate statements instead of 1 combined statement. Does that matter? It depends. If you present clusters of related business rules visually in decision tables, the various possible combinations of conditions and their structure are visualised and readily spotted, so it doesn’t matter. If you have tooling that presents rules in language form, but allows you to make sure that related rules always appear together, it doesn’t matter either. But if you present language statements in database records, or in rows in an Excel spreadsheet, and then use extra columns to categorise, sort and group these statements in multiple ways, the 2 statements could easily drift apart. Semantically, that wouldn’t matter. Each rule would still hold true by itself, even without the other rule in its immediate vicinity. But practically, it could be a different matter. When you read:

A person may be registered as a driver if that person is over 22 years of age.

by itself, you would be excused to think that there are no other possible circumstances under which a person is allowed to be registered as a driver. In other words, it is only too easy to misread the statement as:

A person may only be registered as a driver if that person is over 22 years of age.

Even if all your readers are properly trained in the close reading of natural-language business rules,  the statement is still awkward for two additional reasons.

First, in reality, there is a motivational link between the 2 conditions.  The whole point of the rule is to exclude persons who could be too young, inexperienced, or otherwise prone to accidents to be a driver. At age 23, people are considered old enough to fall outside this category; if younger, their trustworthiness is considered to depend on how long they have held a driving license. Because of this motivational link, it is much easier to read and remember the rule as an integral whole of which the 2 conditions are part.

A second relevant aspect is how many conditions there are in all (in the entire business area under consideration) under which people are allowed to be registered as driver. If there are no other conditions than these 2, the practical advantage of presenting both conditions in 1 statement is that you can phrase that statement so that it tells readers not just when a person may be registered as a driver, but also when not.

This discussion shows that in natural English, or is more than a logical operator expressing that either of 2 parallel conditions are sufficient to draw the conclusion. Over and above expressing that logical structure, or can imply that there is some motivational link between the 2 conditions, and it can imply that there is no 3rd set of circumstances that lead to the conclusion.

Taking a wider view, this discussion also has something to say about how rules may be considered atomic. Because each business rule is supposed to apply in and by itself, independently of surrounding rules, atomicity is often proposed as a quality criterion for good business rules. The idea is that a single rule must not be allowed to say multiple things. People who require atomic rules often suggest that it is easy to see whether or not a rule is atomic. But this discussion shows that it is not self-evident that a rule presenting 2 parallel conditions must be split. There are reasons to consider that after the split, the resulting 2 “more atomic” statements no longer imply the same information, or no longer have the same practical applicability, as the original statement.

Leave a reply