( (Left Parenthesis) is ASCII code point 40 (0x28), Unicode U+0028, and a printable punctuation character. It opens an aside — a grammatical trapdoor that lets you drop a subordinate thought into the middle of a sentence, with its partner ) waiting to snap the reader back to the main track. Almost every programming language uses parentheses to group expressions and invoke functions — f(x) calls a function, (a + b) * c overrides precedence. Lisps take this to the extreme: parentheses are the syntax, nesting so deeply that the closing ))))) at the end of a file is sometimes called "a pile of dead fish." In regular expressions, parentheses create capture groups, letting you extract subpatterns from a match. The gotcha with this character is mismatched nesting: most editors highlight unbalanced parens, but in generated code or long regex patterns, a single missing ( can shift every capture group's index by one, silently returning the wrong substring from every match while the overall expression still compiles without complaint. The symbol appeared in European mathematical notation by the sixteenth century, introduced by writers seeking a cleaner alternative to the vinculum — the overline bar that had previously indicated grouping. UTF-8 encodes it as a single byte 0x28. Unicode classifies it as Ps (Punctuation, Open) with the name LEFT PARENTHESIS. Its mirrored partner ) is U+0029, and the two form one of Unicode's designated "bracket pairs" — distinct from the fullwidth ( (U+FF08) used in CJK typesetting.
int a = 2 + 3 * 4;int b = (2 + 3) * 4; // parentheses change precedenceprintf("%d %d", a, b); // 14 vs 20
Parentheses serve three key roles: function calls (print('hi')), expression grouping to control operator precedence ((a + b) * c), and tuple/capture group creation in regex. Without them, compilers would need different syntax for each purpose — parentheses unify these patterns.
They create capture groups — (\d+) matches and remembers one or more digits. You can reference captures with \1 or $1 in replacements. Non-capturing groups (?:...) group without capturing. Named groups (?P<name>...) make complex regex more readable.
Mismatched parentheses produce some of the most misleading error messages in programming. A missing ) often causes the error to appear on a different line — the compiler keeps looking for the closing delimiter. Editors with bracket matching and rainbow parentheses colorization help prevent this.
They override operator precedence: 2 × (3 + 4) = 14, not 10. In set theory, (a, b) is an ordered pair. In interval notation, (0, 1) means 'between 0 and 1, exclusive.' Programming inherited this precedence-override meaning directly from mathematics.