1

Does the rise of acceptance in "/" for "or" come from the use of "|" in computer programming (For "OR")?

If not is there any correlation?

  • 4
    As someone who extensively uses /, I'm certain it has nothing to do with logical |. – A.S. Feb 29 '16 at 1:03
  • 6
    No. Slash has been used this way long before people programmed computers. – Drew Feb 29 '16 at 2:34
  • The use of "/" for "or" is longstanding. In fact, and/or has, for as long as I can remember, been quite common as a substitution for "and" or "or". – Hot Licks Feb 29 '16 at 2:47
  • 3
    (Though it's likely that the use of "|" for "OR" in math and programming was influenced by the use of "/" in English.) – Hot Licks Feb 29 '16 at 2:49
  • 1
    No, @Chris, my example was completely accidental and incidental but it indeed exhibits the customary "and/or" sense - combining objects of similar/close properties. I wouldn't use "/" to combine (wildly) different categories. – A.S. Feb 29 '16 at 17:47
2

The concept of computer programming includes at least formal logic, circuit design, and the use of modern programming languages. For simplicity, I'll just take Babbage's difference engine of 1822 as a convenient starting date for the sake of comparison.

In English, the virgule dates back to the mid 19th century according to Oxford Dictionaries, so may be argued to start around the same time as computer programming. However, it traces its etymology to usage "as a comma medieval MSS" (etymonline). Arguably, the concept of disjunction was already inherent in this usage.

Note that "/" isn't always simply a logical or in English. An example from thepunctuationguide is office/dining room, in which "/" is equivalent to the Latin preposition cum, as in *office-cum-dining room", where it has an element of conjunction. Compare the Latin phrase summa cum laude - it isn't simply best or praised - it's both (excuse my poor Latin).

The vertical bar as disjunction in computer programming can be traced back to the Backus-Naur Form (follow the links in this stackoverflow answer) from about 1958 or 1959 (see also ALGOL 58), where the vertical bar represents choice. Here's an example of such an expression:

digit ::= "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"

So there seems to be little correlation between the etymology of the disjunctive "/" in English and that of computer programming's "|", other than perhaps that both are particularly visual representations of some kind of list separator.

  • Do you know why is inclusive OR called disjunction which upon naive reading would mean exclusive OR (i.e. XOR). Conjunction seems like a better choice for OR. – A.S. Feb 29 '16 at 21:32
  • @A.S. I don't know for sure, but if you go back through the earlier maths of set theory and Venn diagrams, the notion of conjunction (and) was already formalised as intersection. The truth-table definition of the logical and already had this background, leaving set union for the inclusive or / disjunction. Note that exclusive or doesn't quite map as nicely to set union, and the mathematical discipline of logic likely had greater weight than English semantics in the definition of programming's and and or. – Lawrence Feb 29 '16 at 23:19
  • Having looked up detailed definition of conjunction, it seems like an OK, if somewhat ambiguous, choice for AND. But I'm still bothered by math/logician's choice of disjunction for inclusive OR since dis doesn't resonate with "inclusion" at all and resonates well with XOR (which is equal to the union of two disjoint sets A\B and B\A). Most "lay terms" for mathematical objects do correlate at least slightly with English semantics - or at least don't contradict it. – A.S. Mar 1 '16 at 1:16
  • @A.S. Perhaps this is an instance of a semantic shift of sorts: separate to split to choice to aggregate. The set-union understanding of logical disjunction has the notion of an aggregate of the various choices. As you say, the plain English word disjoint has the opposite sense. – Lawrence Mar 1 '16 at 8:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.