double bar
- noun
- /ˈdʌbəl bɑr/
- Specialized
- In programming, the double bar operator || checks if at least one condition is true.
Examples
-
In most languages, the double bar returns true when either left or right expression is true.
-
She replaced the nested if-statements with a single double bar condition to simplify the code.
-
During debugging he noticed the double bar was short-circuiting, so the second function never ran.
-
The double bar is essential.
-
Use a double bar in your code.
-
You can use a double bar in your expressions to evaluate multiple conditions at once.
-
The programmer found that using a double bar simplified his logic checks.
Surface Forms
Morphology
double + bar
The phrase literally composes 'double' (twofold) with 'bar' (a bar/line), so a learner can derive the idea of two bars (i.e. '||') from the constituents. However, understanding that this specific two-bar sequence functions as the logical OR operator in programming requires domain-specific knowledge not provided by the constituent meanings alone, so the overall meaning is not fully predictable for a B1 learner.
Etymology
Double bar in programming comes from the symbol ||, two vertical lines side by side that stand for 'or' in code. That's why the symbol gives 'true' if at least one part of the check is true.